# Robot Will Not Stop in Autonomous Code

Hi, we’re a new Vex team and we’ve been having some trouble with our autonomous code. When our robot runs the code, it lifts our arm (the first command), moves forward (the second command), and then lowers the arm (our third command). But all during our third command, our robot is still moving forward. We have tried decreasing the amount of time we run the second command for, but it has not done anything.

Here is a snippet of our robot’s autonomous code:

motor[chainLift] = 127; // Our first command
wait1Msec(3400);

motor[rightDrive] = 127; // Our second command
motor[leftDrive] = 127;
wait1Msec(2410);

motor[chainLift] = -127; // Our third command
wait1Msec(1150);

Any help would be appreciated!

you have to tell the motors to equal zero after you tell them to equal 127, or no matter how long you wait they’ll keep equalling 127.

Do you mean like this?

motor[rightDrive] = 127; // Our second command
motor[leftDrive] = 127;
wait1Msec(2410);
motor[rightDrive] = 0;
motor[leftDrive] = 0;

@Adriana102

``````
motor[chainLift] = 127; // Our first command
wait1Msec(3400);
motor[chainLift] =0; //stop the motors after the set amount of time

motor[rightDrive] = 127; // Our second command
motor[leftDrive] = 127;
wait1Msec(2410);
motor[leftDrive] =0;  //stop the motors after the set amount of time
motor[rightDrive] =0;  //stop the motors after the set amount of time

motor[chainLift] = -127; // Our third command
wait1Msec(1150);
motor[chainLift] =0; //stop the motors after the set amount of time

``````

Thank you very much for the help!

Yes, that should do it.

I would also suggest you not run the motors at 127. The difference in speed between 90 and 127 is very minimal but the difference in how quickly they will burn out is quite a bit. If you talk to some of the top teams in the world, most of them do not exceed 90 or 100 even in driver control.

Also if your going to be holding weight with your autonomous, instead of 0 use 5 for a cone, and 20 for a base

By motors burning out, do you mean the PTC tripping or how long the motor lasts overall?