Understanding Gamepad Controllers - Dutton-Christian-Robotics/Learning-to-Code GitHub Wiki
So far we've only looked at autonomous opmodes where we determine in advance what the robot should do. But that's only a portion of an FtC game. How do we make the robot do what our driver and manipulator want it to?
Opmode objects come with two property variables, gamepad1 and gamepad2, each of which gives the ability to determine what buttons or sticks are pressed on the controller.
Types of Controls
- analog: responds with a numeric value with decimal values, usually between -1 and 1
- digital: responds with an on or off, represented as either 0 or 1
Available Controls
Types: analog and digital
- left_stick_y, left_stick_x, right_stick_y, right_stick_x
- quirks of the y axis
- left_trigger, right_trigger
- left_bumper, right_bumper
- dpad_up, dpad_down, dpad_left, dpad_right
- x, y, a, b
Other Controls
Not available on all controllers, and some don't work predictably
- left_stick_button, right_stick_button
- back, guide, start
- touchpad_finger_1, touchpad_finger_1_x, touchpad_finger_1_y
- touchpad_finger_2, touchpad_finger_2_x, touchpad_finger_2_y