Autonomous isn't doing anything

My team has recently started to work on an autonomous, but when we tested our first movement nothing happened. Here is the code:

  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  
 
  // All activities that occur before the competition starts
  // Example: clearing encoders, setting servo positions, ...
}

/*---------------------------------------------------------------------------*/
/*                                                                           */
/*                              Autonomous Task                              */
/*                                                                           */
/*  This task is used to control your robot during the autonomous phase of   */
/*  a VEX Competition.                                                       */
/*                                                                           */
/*  You must modify the code to add your own robot specific commands here.   */
/*---------------------------------------------------------------------------*/

void autonomous(void) {
//DRIVE VELOCITIES(lma = leftMotor A, rma = rightMotor A, and so on)
lma.setVelocity(100, percent);
lmb.setVelocity(100, percent);
rma.setVelocity(100, percent);
rmb.setVelocity(100, percent);

//DRIVE STOPS
lma.setStopping(brake);
lmb.setStopping(brake);
rma.setStopping(brake);
rmb.setStopping(brake);

lma.spin(fwd);
lmb.spin(fwd);
rma.spin(fwd);
rmb.spinFor(fwd, 1000, deg);



}```

You added

lma.setStopping(brake); lmb.setStopping(brake); rma.setStopping(brake); rmb.setStopping(brake);

Which stops the drive train completely
Change it to

lma.stop(); 
lmb.Stop(); 
rma.Stop(); 
rmb.Stop();

And I would switch the moving forward code with the stopping

your code seems fine overall. It may be something else or other parts of the code.

turns out I had to move the driver control code into the driver control function thank you guys for your help anyways

1 Like