?
Code:
bool stopp = false;
[...]
if (!stopp)
{
DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
if (button.get())
{
stopp = true;
DriveTrain.tankDrive(0.0, 0.0);
}
Sorry. I've actually been programming in C++. This year we had a function using something like this that would take control from the driver and autonomously take control using the sensors. It was flawless (we programmed it during the final three rounds of the competition :P )