Thread: Stop Driving
View Single Post
  #8   Spotlight this post!  
Unread 06-04-2013, 02:00
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: Stop Driving

Quote:
Originally Posted by ekapalka View Post
How about this?
Code:
bool stopp = false;
[...]
if (!stopp)
{
    DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
if (button.get())
{
    stopp = true;
}
Does this help?
This example will only work if you're using RobotDrive, have its safety feature enabled, and have the timeout set low enough. Otherwise, it'll just stop changing the motors' speeds instead of actually stopping them.
__________________
I code stuff.
Reply With Quote