Skip to main content
Version: 2.x

Drive and Telemetry

Set Drive​

set_tank()​

Sets the drive to voltage.

left an integer between -127 and 127
right an integer between -127 and 127

void set_tank(int left, int right);

set_drive_brake()​

Sets brake mode for all drive motors.

brake_type takes either MOTOR_BRAKE_COAST, MOTOR_BRAKE_BRAKE, and MOTOR_BRAKE_HOLD as parameters

void set_drive_brake(pros::motor_brake_mode_e_t brake_type);

set_drive_current_limit()​

Sets mA limit to the drive. Default is 2500.

mA input miliamps

void set_drive_current_limit(int mA);

Telemetry​

right_sensor()​

Returns right sensor value, either integrated encoder or external encoder.

int right_sensor();

right_velocity()​

Returns integrated encoder velocity.

int right_velocity();

right_mA()​

Returns current mA being used.

double right_mA();

right_over_current()​

Returns true when the motor is pulling too many amps.

bool right_over_current();

left_sensor()​

Returns left sensor value, either integrated encoder or external encoder.

int left_sensor();

left_velocity()​

Returns integrated encoder velocity.

int left_velocity();

left_mA()​

Returns current mA being used.

double left_mA();

left_over_current()​

Returns true when the motor is pulling too many amps.

bool left_over_current();

reset_drive_sensor()​

Resets integrated encoders and trackers if applicable.

void reset_drive_sensor();

reset_gyro()​

Sets current gyro position to parameter, defaulted to 0.

void reset_gyro(double new_heading = 0);

get_gyro()​

Gets IMU sensor, value is degrees.

double get_gyro();

imu_calibrate()​

Calibrates IMU, and vibrates the controller after a successful calibration.

bool imu_calibrate();