Setting motor speed PROS code

I am using PROS code in VSCode and I was looking up ways to reduce the motor speed from the max speed. Anyone have any documentation or insight on how to reduce the max motor speed for the drive train motors?

Here is the PROS C++ API
If you check the Motor class, you can see that move_velocity will do what you’re looking for.

Thanks! Can the same code be used to set the max velocity or the speed of the motors in driver control?

If you are trying to limit your drivetrain motors to only, for example, 75% when using a controller move_velocity won’t do that. It is used to make the motor spin at your desired RPM.

If you wanted to make it so your controller input is limited to a certain amount, you could multiply your controller input by the amount you want to scale it down by, then feed that value to your motor with move.

As an example:

//Scale controller values down to 75%
double motorSpeed = controller.get_analog(E_CONTROLLER_ANALOG_LEFT_Y) * .75; 
motor.move(motorSpeed);

Edit: Due to motor_velocity taking in RPM as the value for ranges of 100, 200, and 600 depending on motor cartridge, it wouldn’t work. move does the same thing as move_velocity but instead takes a voltage value from -127 to 127. This is the same range that the controller axis returns, so this would be used instead. I’ve updated the example to reflect the changes.

I was able to just multiply the controller input by the amount I wanted to scale it down my, thanks!