nMotorPIDSpeedCtrl, problems with setting speed


#1

Hi everyone,
I am fairly new to using VEX. I am trying to make my robot drive straight and decided to try using “nMotorPIDSpeedCtrl[motorC] = mtrSpeedReg”
It works, however, I am unable to change the speed. I am using a VEX Cortex microcontroller and Vex 393 motors with integrated motor encoders.

This is the code I am running (using robotC)

task main(){
while(true){
resetMotorEncoder(motorB);
resetMotorEncoder(motorC);

nMotorPIDSpeedCtrl[motorC] = mtrSpeedReg;
nMotorPIDSpeedCtrl[motorB] = mtrSpeedReg;

//this is where I am attempting to change speed
motor[motorC] = 40;
motor[motorB] = 40;
}
}

Am I using it wrong? I did some googling/forum searching but was unable to come up with a result. Thank you for any help