|
Re: Dividing Speed on Robot Drive
It needs to be placed in the "IsOperatorControl()" loop where TankDrive() is being called now. call the GetY() method of the joysticks to get the value and multiply it by your scale. I would use decimals like 0.25. For example:
R_myRobot.TankDrive(J_stick1->GetY() * 0.25, J_stick2->GetY() * 0.25);
When you don't want to scale keep
R_myRobot.TankDrive(J_stick1, J_stick2);
In our example below, you forgot to multiply by 0.5 when button one was pressed.
You don't need "== true" in your checks for GetRawButton(). It returns a bool
__________________
Brian K
Team 1225 Robotics Mentor
|