In your operator control loop, you can write something like this:
Code:
if ((rightstick->GetRawButton(6) == 1) && (rightstick->GetRawButton(7) == 0)) //if button 6 is pressed and button 7 is released
{
//In this check you will either "set" your victors
victora->Set(.7f);
//Or use a myrobot function
myrobot.drive(//set parameters);
}
else if((rightstick->GetRawButton(7) == 1) && (rightstick->GetRawButton(6) == 0)) //if button 7 is pressed and button 6 is released
{
// "set" your victors
victora->Set(-.7f);
//Or use a myrobot function
myrobot.drive(//set parameters);
}
else // if nothing is pressed set all victors to zero or use a myrobot.drive with 0.0f
{
// turn off everything
victora->Set(0.0f);
//Or use a myrobot function
myrobot.drive(//set parameters to 0.0f);
}
This will make sure your victors are being set to zero if both buttons are pressed or released. Test your robot on blocks before trying to drive!