Programming Speed in VEXcode Pro

I have a question; how you increase the speed of the robot in VEXcode pro? I am new to VEXcode pro and C++.

What are you trying to accomplish? Are you trying to increase the speed of one motor or multiple motors at the same time with code?

Use the VEXCode Pro API:
Motor methods
Motor group methods
Drivetrain methods
Look for methods that set the velocity/RPM of the object.

1 Like

I am trying to increase the speed of a 6 motor drivetrain

Use the set velocity function
Examples:
Motor1.setvelocity (500, rpm)
Or if you are using a drivetrain group use
Drivetrain.setvelocity (500, rpm)

If we are talking about the motors that make up the drivetrain:

motor.spin(12.0, voltageUnits::volt);

Voltage is from -12.0 to 12.0, with 0 being stopped.

The example code given is wrong. It should be

motor.spin(forward, 12.0, voltageUnits::volt);

According to the documentation found here

1 Like

You are correct. Thank you for correcting my error. I initially thought the function was overloaded to accomodate not having that, but it appears that’s not the case. I looked at my example code in one of my vexcode libraries and you are correct that my code above is wrong:

        vex::motor::spin(volts, voltageUnits::volt);

However your code is right:

        vex::motor::spin(forward, volts, voltageUnits::volt);

Also the following works too

        vex::motor::spin(fwd, volts, voltageUnits::volt);