|
Axis 1 because it is the forward-backward axis on the left stick and Axis 3 because it is the forward-backward axis on the right stick. We purposely skipped 0 and 2, which are the sideways axes. To get the value of the axes we do "gamepad.getRawAxis(1)" and "gamepad.getRawAxis(3)" and store those in separate variables of type double. The speeds are then multiplied by a selected modifier in the array [0.25, 0.5, or 0.75] the index of which is determined by the press of 3 buttons. We then plug the modified speed in like so: "drive.TankDrive(modifiedSpeedLeft, modifiedSpeedRight)"
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
|