View Single Post
  #3   Spotlight this post!  
Unread 29-02-2012, 12:05
andreboos andreboos is offline
Registered User
FRC #3021 (The Agency)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: San Diego
Posts: 132
andreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the rough
Re: Wiring a limit switch.

Just one more option to consider:

If you're out of Digital I/O ports (like I was this year), you can also wire to the analog breakout. Connect +5v and Signal when the limit switch is engaged, and then check in code whether the analog channel reads above or below 2.5V.

Something you have to remember about programming Jon's first option: the channel will read 1 unless signal and ground are connected, in which case it would read zero. That confused me for a while when our limit switches did not work as programmed.