Is it possible to use voltage units to spin motors in python?

I recently downloaded the vex VS Code extension and have been experimenting with the python part of it. I noticed that for motor.spin(), it only accepts RPM values, instead of voltage as well like in pros or vexcode pro. I heard that using voltage instead of RPM bypassed the motors’ PID and made them go faster. So is there any way to use voltage instead of RPM. Or would it even matter in my case?

Just pass the units as VOLT or MV.

// spin at 12 volts
motor1.spin(FORWARD, 12, VOLT)

// or 12000 mV
motor1.spin(FORWARD, 12000, VoltageUnits.MV)
6 Likes

Thanks for the reply, it seems to be working for the individual motors. However, if I try to do

motorGroup1.spin(FORWARD, 12, VOLT)
# or
motorGroup1.spin(FORWARD, 12000, VoltageUnits.MV)

It gives me an error. I didn’t expect motor and motor group to work differently here, is there any way to get motor groups to work with volts? It’s not really a big problem though as I could just use individual motors.

1 Like