I am using C++ to code and I do not know why my Auton is not working

#include "vex.h"
   

void autonomous() {

  Drivetrain.drive(forward);
  wait(2, seconds);
  Drivetrain.stop();
}

int main() {
 
  while (true) {
    // User control code...
    // Add your user control logic here...
    if (Controller1.ButtonR1.pressing()) {
      Intake.spin(forward);
    } else if (Controller1.ButtonR2.pressing()) {
      Intake.spin(reverse);
    } else {
      Intake.stop();
    }

    if (Controller1.ButtonL1.pressing()) {
      Catapult.spin(reverse);
    } else if (Controller1.ButtonL2.pressing()) {
      Catapult.spin(forward);
    } else {
      Catapult.stop();
    }
  }

  return 0;
}

All of my motors are working

You should change your code to follow the competition template and then use the programming skills option on the controller. Here’s how to do it vexcode pro v5 but I’m not sure if that’s what you’re using https://kb.vex.com/hc/en-us/articles/360036286691-Using-the-Competition-Template-in-VEXcode-Pro-V5

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.