Wiring A Dipswitch

well i was trying to put a dipswitch into one of the Digital Inputs but i cant seem to get a signal from it. its a basic switch (open and close) and i have ground connected to the lower pin (in which case the switch is open) and i have signal connected to the other pin (in which case the switch is closed) but a closed switch does not seem to send a signal to the robot controller. any ideas?

Suggest making sure your programmer has enabled the +5 V pull-ups on the inputs.

i’m sorry what do you mean by +5V pull-ups?

Make sure your dip switch is connected to digital in/out pins. For the Digital In/Out ports on the RC, your user code must define whether the port pin is an input or an output. By defining the port pin as an input, there is a resistor allowing a small amount of current (large resistance) connected from that input pin to the +5 V supply built into the RC (the “weak pulll-up”). Your dipswitch is connected such that if the switch is open, the RC should read a logic “1”, and conversely, a logic “0” when the switch is closed. On the IFIRobotics site, there is a manual on the RC which provides more information.

If you’re talking about the digital inputs on the Robot Controller, a switch connected between signal and ground is exactly the right way to do it. An open switch will be read as 1, and a closed switch will be read as 0.

How are you determining that no signal is being sent?

To emphasize what MCahoon wrote: These pins can be inuts or outputs (you have to say which) - obviously, if #1 is configured as an output your RC will have a tough time reading the switch value…

(I know this from experience)

Don