PTO
pto_check()​
Checks if the motor is currently in pto_list.
Returns true if it's already in pto_list.
check_if_pto
motor to check
- Prototype
- Example
void initialize() {
pros::delay(500);
printf("Check: %i %i\n", chassis.pto_check(chassis.left_motors[1]), chassis.pto_check(chassis.right_motors[1]))); // This prints 0 0
chassis.pto_add({chassis.left_motors[1], chassis.right_motors[1]});
printf("Check: %i %i\n", chassis.pto_check(chassis.left_motors[1]), chassis.pto_check(chassis.right_motors[1]))); // This prints 1 1
}
bool pto_check(pros::Motor check_if_pto);
pto_add()​
Adds motors to the pto list, removing them from the drive.
You cannot add the first index because it's used for autonomous.
pto_list
list of motors to remove from the drive
- Prototype
- Example
void initialize() {
pros::delay(500);
printf("Check: %i %i\n", chassis.pto_check(chassis.left_motors[1]), chassis.pto_check(chassis.right_motors[1]))); // This prints 0 0
chassis.pto_add({chassis.left_motors[1], chassis.right_motors[1]});
printf("Check: %i %i\n", chassis.pto_check(chassis.left_motors[1]), chassis.pto_check(chassis.right_motors[1]))); // This prints 1 1
}
void pto_add(std::vector<pros::Motor> pto_list);
pto_remove()​
Removes motors from the pto list, adding them to the drive.
pto_list
list of motors to add to the drive
- Prototype
- Example
void initialize() {
pros::delay(500);
printf("Check: %i %i\n", chassis.pto_check(chassis.left_motors[1]), chassis.pto_check(chassis.right_motors[1]))); // This prints 0 0
chassis.pto_add({chassis.left_motors[1], chassis.right_motors[1]});
printf("Check: %i %i\n", chassis.pto_check(chassis.left_motors[1]), chassis.pto_check(chassis.right_motors[1]))); // This prints 1 1
chassis.pto_remove({chassis.left_motors[1], chassis.right_motors[1]});
printf("Check: %i %i\n", chassis.pto_check(chassis.left_motors[1]), chassis.pto_check(chassis.right_motors[1]))); // This prints 0 0
}
void pto_remove(std::vector<pros::Motor> pto_list);
pto_toggle()​
Adds/removes motors from drive.
You cannot add the first index because it's used for autonomous.
pto_list
list of motors to add/remove from the drive
toggle
list of motors to add/remove from the drive
- Prototype
- Example
void pto_intake(bool toggle) {
pto_intake_enabled = toggle;
chassis.pto_toggle({chassis.left_motors[1], chassis.right_motors[1]}, toggle);
pto_intake_piston.set_value(toggle);
if (toggle) {
chassis.left_motors[1].set_brake_mode(pros::E_MOTOR_BRAKE_COAST);
chassis.right_motors[1].set_brake_mode(pros::E_MOTOR_BRAKE_COAST);
}
}
void pto_toggle(std::vector<pros::Motor> pto_list, bool toggle);