|
Re: How to code limit switch to stop movement
Generally we wire our limit switches to read 1 when they are pressed (the limit is hit) and 0 otherwise. That way if the switch gets disconnected it reads as though it's pushed, and the mechanism won't move toward the limit. Your team has to decide whether you want the mechanism to still work with a disconnected switch (risking damage) or stop if the switch is disconnected, rendering the mechanism not fully operational. This kind of design consideration is called "risk management."
Digital Inputs are "pulled up" through a resistor to +5v and will read 1 when there's no connection. The pneumatic pressure switch is wired in this manner, a disconnected switch reads the same as at full pressure. Therefore, the pump won't run with a disconnected pressure switch.
__________________
Silicon Valley Regional 2005, 2006 972
Silicon Valley Regional 2007 668 Xerox Creativity Award
Championship Event 2007 668
Portland Regional 2008 668
Silicon Valley Regional 2008 668, 972
Beta Test Team 2008 668 (with 100 & 254)
Silicon Valley Regional 2009 668 Regional Chairman's Award; 2643
Sacramento Regional 2009 668 Winning Alliance (thanks, 1717 & 2473!), 2010 Winning Alliance 3256
CalGames 2006, 2007, 2008, 2009, 2010, 2011 Field Tech
NorCal FTC Regional 2008, 2009 Inspector
Championship Event 2009
San Diego, Silicon Valley Regionals; Champ. Event 2010 668, 2643, 3256
Silicon Valley, Madera Regional 2012 2643
WRRF Programming Instructor 2006-2016
Regional Woodie Flowers Award 2014 2643 Utah Regional
|