View Single Post
  #9   Spotlight this post!  
Unread 10-02-2015, 21:30
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Micro Switch Wiring & Programming

Quote:
Originally Posted by Alan Anderson View Post
In a procedural language like C++ or Java, the programming for a limit switch is simple. Just before you call the motor.Set() method, test to see whether the value to send to the motor is forward while the forward limit switch is active, and set the value to zero if so. If you also have a reverse limit switch, add another test to see whether the motor value is reverse while the reverse switch is active, and zero the value if so. Only then do you actually set the motor to that value.
What is the name of the object when introducing the limit switch to the program?