Skip to main content
Version: 3.2.1

User Control

Drive Modes​

opcontrol_tank()​

Sets the chassis to controller joysticks using tank control.
Run in usercontrol.

This passes the controller through the curve functions, but is disabled by default.
Use opcontrol_curve_buttons_toggle() to enable it.

void opcontrol_tank();

opcontrol_arcade_standard()​

Sets the chassis to controller joysticks using standard arcade control, where left stick is fwd/rev.
Run in usercontrol.

This passes the controller through the curve functions, but is disabled by default.
Use opcontrol_curve_buttons_toggle() to enable it.

stick_type ez::SINGLE or ez::SPLIT control

void opcontrol_arcade_standard(e_type stick_type);

opcontrol_arcade_flipped()​

Sets the chassis to controller joysticks using flipped arcade control, where right stick is fwd/rev.
Run in usercontrol.

This passes the controller through the curve functions, but is disabled by default.
Use opcontrol_curve_buttons_toggle() to enable it.

stick_type ez::SINGLE or ez::SPLIT control

void opcontrol_arcade_flipped(e_type stick_type);

Joystick Curves​

opcontrol_curve_sd_initialize()​

Initializes left and right curves with the SD card, recommended to run in initialize().

void opcontrol_curve_sd_initialize();

opcontrol_curve_default_sets()​

Sets the default joystick curves.

left left default curve
right right default curve

void opcontrol_curve_default_set(double left, double right);

opcontrol_curve_buttons_toggle()​

Enables/disables modifying the joystick input curves with the controller.

toggle true enables, false disables

void opcontrol_curve_buttons_toggle(bool toggle);

opcontrol_curve_buttons_toggle_get()​

Gets the current state of the toggle. Enables/disables modifying the joystick input curves with the controller.

True enabled, false disabled.

bool opcontrol_curve_buttons_toggle_get();

opcontrol_curve_buttons_left_set()​

Sets buttons for modifying the left joystick curve.

decrease a pros button enumerator
increase a pros button enumerator

void opcontrol_curve_buttons_left_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase);

opcontrol_curve_buttons_right_set()​

Sets buttons for modifying the right joystick curve.

decrease a pros button enumerator
increase a pros button enumerator

void opcontrol_curve_buttons_right_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase);

opcontrol_curve_left()​

Outputs a curve from 5225A In the Zone.

This gives more control over the robot at lower speeds.

x joystick input

double opcontrol_curve_left(double x);

opcontrol_curve_right()​

Outputs a curve from 5225A In the Zone.

This gives more control over the robot at lower speeds.

x joystick input

double opcontrol_curve_right(double x);

opcontrol_curve_buttons_iterate()​

Allows the user to modify the curve with the controller.

void opcontrol_curve_buttons_iterate();

Joystick General​

opcontrol_joystick_threshold_set()​

Sets a new threshold for the joystick.

The joysticks wil not return a value if they are within this.

threshold new threshold

void opcontrol_joystick_threshold_set(int threshold);

opcontrol_joystick_threshold_iterate()​

Runs the joystick control. Sets the left drive to l_stick, and right drive to r_stick. Runs active brake and joystick thresholds.

l_stick left joystick value
r_stick right joystick value

void opcontrol_joystick_threshold_iterate(int l_stick, int r_stick);

opcontrol_joystick_practicemode_toggle()​

Practice mode for driver practice that shuts off the drive if you go max speed.

toggle true enables, false disables

void opcontrol_joystick_practicemode_toggle(bool toggle);

opcontrol_joystick_practicemode_toggle_get()​

Gets current state of the toggle.

True is enabled, false is disabled.

ool opcontrol_joystick_practicemode_toggle_get();

Active Brake​

opcontrol_drive_activebrake_set()​

Runs a PID loop on the drive when the joysticks are released.

kp proportional term
ki integral term
kd derivative term
start_i error threshold to start integral

void opcontrol_drive_activebrake_set(double kp, double ki = 0.0, double kd = 0.0, double start_i = 0.0);

opcontrol_drive_activebrake_get()​

Returns kP of active brake.

double opcontrol_drive_activebrake_get();

opcontrol_drive_activebrake_constants_get()​

Returns all PID constants for active brake.

PID::Constants opcontrol_drive_activebrake_constants_get();

Reversing Drive​

opcontrol_drive_reverse_set()​

Reversal for drivetrain in opcontrol that flips the left and right side and the direction of the drive.

toggle true if you want your drivetrain reversed and false if you do not

void opcontrol_drive_reverse_set(bool toggle);

opcontrol_drive_reverse_get()​

Returns true if the drive is currently reversed, and false if it isn't.

bool opcontrol_drive_reverse_get();