Voltage in VexCode

I was coding some code and I could not figure out how to set motors to run at a specific voltage in VexCode like I can in PROS. Is there a way to do that? I was trying to use LBDrive.spin(directionType::fwd, voltageLeft, velocityUnits:: ); but VexCode refused to take anything like voltage.

for example.

LBDrive.spin( fwd, 10.0, voltageUnits::volt );
7 Likes

Hey thanks that helps.

What’s the maximum voltage the motor can use? Also, what’s the difference between using spin( voltage ) and spin( velocity )? Thank you!

Max voltage is 12V, if you try 13V it will be limited to 12V in several places.
spin using voltage disables the motor pid control, it is controlled more like a 393 motor on the cortex.

6 Likes

why would you use voltage on arms