EZ-Robotics / EZ-Template

Simple plug-and-play PROS template that handles drive base functions for VEX robots.
https://ez-robotics.github.io/EZ-Template/
Mozilla Public License 2.0
73 stars 35 forks source link

Add drive current limit function #20

Closed ssejrog closed 2 years ago

ssejrog commented 3 years ago

Is your feature request related to a problem? Please describe.

User cannot adjust max current of the drive motors.

Describe the solution you'd like

Give the user access to change the max current the drive motors can use, call the function set_drive_current_limit()

Additional context

Useful for VEXU teams using more then 8 motors . Use motor.set_current_limit(input in mA);.

ssejrog commented 2 years ago

Welcome to the team, @LiamCahill0714, this is your first task 🍡

ssejrog commented 2 years ago

Tested, this code works as expected, printing current: 1000 to the screen.

void opcontrol() {
  chassis.set_drive_current_limit(1000);
  while (true) {
    printf("current %i \n", chassis.left_motors.front().get_current_limit());

    pros::delay(10);
  }
}