Main Site Documentation

CerbuinoBee Digital Input expectations?


#1

I’m trying to use the CerbuinoBee with a physical switch, but I’m not finding anything that changes the state, I seem to remember with my Panda that it wasn’t something I could just connect to the 3.3v, GND, or an output, but I don’t remember what and haven’t been able to find it and the docs I’ve found all seem to address the programming side. I’m using port marked D0 on the Arduino header

port = new InputPort(FEZCerbuino.Pin.Digital.D3, false, Port.ResistorMode.PullDown);
Debug.Print(port.Read());

What do the digital inputs expect? I’d like to have it be something from the board itself just for simplicity when developing.


#2

How is the switch/button connected?


#3

One end is connected to D0 on the Arduino headers though I can move it to a different pin if I need to. I am trying to figure out what on the board I can plug the other end of the switch into.


#4

Connect it to the opposite state if the pull resistor. You used pull down then connect to 3.3v


#5

OK, I wasn’t seeing a change when I did that, but I may have mixed up the pins with the identifiers in code, I’ll look through it all more and hopefully sort it out.


#6

I figured out that D0 on the board is D6 in code thanks to using an alternating output port and seeing it jump up and down on the multimeter. Switching it back to an InputPort I am not getting a state change when connecting it to 3V3 with a jumper wire to reduce as many problem points as I can, the port shows true with or without the wire connected to 3V3. I also tried D1 and D2 but have had no luck.

Here is my port creation:
new InputPort(FEZCerbuino.Pin.Digital.D6, true, Port.ResistorMode.PullDown);

Here is the PIN definition from the FEZCerberino file:

           /// <summary>Digital I/O.</summary>
            public const Cpu.Pin D6 = GHI.Hardware.FEZCerb.Pin.PA10;

Any idea what I’m missing?


#7

I got it all working on D7, so not sure why the lower ports weren’t cooperating but I’ve got one working for input that that’s what I needed, thanks.