Created
August 24, 2015 21:54
-
-
Save leoforney/4fe2352e901fe3ae6948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the power that only has a max of 75%... | |
int multPower = 0.75; | |
// your loop statement here... | |
public void loop() { | |
// Get numeric value from gamepad1 on the left trigger, can be changeable... | |
float leftTriggerPressed = gamepad1.left_trigger; | |
if (leftTriggerPressed != 0) { | |
// If the left trigger is slightly to all the way pressed, set the power to a max of 45% | |
multPower = 0.45; | |
} else { | |
// If the left trigger is released set power back to 75% | |
multPower = 0.75; | |
} | |
// after some lines of code | |
motorRight.setPower(right * multPower); | |
motorLeft.setPower(left * multPower); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment