Shooter Speed Variable Control

Print Friendly, PDF & Email

A boolean variable, trigger control, is used to determine which shooter speed method is in use. The repeat-while loop right after first comment is a method to debounce the gamepad switch. This structure is used several times in the code.

We discovered an error in Bruce Schafer’s Blocks Programming Reference Manual. This manual shows that gamepad.RightTrigger (and LeftTrigger) is a boolean. The Blocks interface to the self-hosted development environment shows that RightTrigger and LeftTrigger return a decimal value from 0 to 1 depending on how hard the trigger button is pushed.

Both of our robot drivers have made little use of the trigger control method, preferring to use the fixed low-med-high buttons and adjust their aim with the robot position on the floor.