Quote:
Originally Posted by SuperBK
if the limit switch is a double throw (has common, NO and NC) then you could connect 5V to NO, Gnd to NC, and the signal to common. The switch would then either switch the signal to 5v or ground. Be careful not to put 5v or gnd on the common terminal, or one state will give you a short.
Reversing 5V and ground would change polarity or just change in software.
Get the analog port for greatere or less than 2.5 volts.
|
As indicated here, it's important to make sure your electrical set up ensures a definitive value regardless of the input form the sensor. The digital inputs have a pull up which accomplishes this for you, but the analog inputs do not. floating inputs are unreliable, and even if they seem to work in the pit, you know they'll fail to work at the most critical time on the field, and be next to impossible to debug!