View Single Post
  #12   Spotlight this post!  
Unread 01-03-2012, 01:53
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Mentor, LRI, MN RPC
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,813
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Wiring a limit switch.

Quote:
Originally Posted by SuperBK View Post
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!