I am trying to divide the speed of the motors...
by 1/2 when Button 1 of Stick 1 is pressed;
by 3/4 when Button 1 of Stick 2 is pressed; and
by 1/4 when Button 1 of Both sticks are pressed.
Where is the best place to add the divide function.
Code:
// Drive
if(J_stick1.GetRawButton(1) == true)
R_myRobot.TankDrive(J_stick1, J_stick2);
else
if(J_stick2.GetRawButton(1) == true)
R_myRobot.TankDrive(J_stick1, J_stick2)*3/4;
else
if(J_stick1.GetRawButton(1) == true && J_stick2.GetRawButton(2) == true)
R_myRobot.TankDrive(J_stick1, J_stick2)/4;
else
R_myRobot.TankDrive(J_stick1, J_stick2);