How Do I Check the Voltage Going to a Motor in Vexcode?

Pretty much the title… I wanna create a P-loop for the motors and I’m using voltage in order to avoid the built in pid curves with rpm and percent. The issue is that I have no idea how to get the current voltage going to the motor.

I’m not familiar with VexCode’s API, but even if it doesn’t have a getVoltage or similar function, couldn’t you just store the voltage in an intermediate variable and use that as feedback into the P loop and to set the motor?

2 Likes