View Single Post
  #2   Spotlight this post!  
Unread 03-02-2014, 16:17
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: How to properly set up a Limit Switch

That depends on how you use it. In our code (eg. this file from last year), we make the DigitalInput part of the subsystem, then access it from outside with a more significant name (isForward() in this case). By doing it this way, the rest of the code does not have to care too much about the internal details, and if it turns out that the limit switch indicates the opposite of what you think, you can negate it in that named method, so it only has to be done in one place.
__________________
I code stuff.
Reply With Quote