Control Voltage in VEX C++

I was wondering if anyone knew how to set voltage for motors in Vex C++ using Vex Coding Studio. I am trying to do PIDs but I cannot find anything in the API about controlling motor voltage. Any help would be appreciated.

The prototype you want is:

void vex::motor::spin(directionType dir, double voltage, voltageUnits units);

More info here.


Is this for Vex Coding Studio? Because I clicked on the link but it lead me to VEXcode API.

Yeah, I linked to the VEXcode docs because the VCS docs have a habit of not working in my browser. But the API is almost exactly the same, and you should be able to verify that the same prototype exists in the VCS docs (they work fine in chrome IIRC).


VCS does not support the voltage control API.

The SDK that VCS is using is now almost 18 months old and a lot has changed, please move on and start using VEXcode.