|
Re: Programming Limit Switches
What you want to do is use code that is sort of like the following:
if(limitSwitch.get() == true){
motorName.stopMotor();
}
This code waits for a limit switch to be pressed. When it is pressed it turns true, triggering the contents of the if statement. The contents call the WPI method stopMotor on the motor. Hopefully this helped.
|