Vexcode Error Help

When trying to download my programming to my robot, I receive this message:

[error]: make process closed with exit code : 2

What does this mean and how can I fix this?

That error code means ‘your code has errors.’

we need to see the whole code or at the very least the rest of the log to identify the error.

be sure to wrap your code in [code] and [/code] so it’s readable for anyone who isn’t a sociopath

5 Likes
#include "vex.h"

using namespace vex;

// A global instance of competition
competition Competition;

// define your global instances of motors and other devices here

/*---------------------------------------------------------------------------*/
/*                          Pre-Autonomous Functions                         */
/*                                                                           */
/*  You may want to perform some actions before the competition starts.      */
/*  Do them in the following function.  You must return from this function   */
/*  or the autonomous and usercontrol tasks will not be started.  This       */
/*  function is only called once after the V5 has been powered on and        */
/*  not every time that the robot is disabled.                               */
/*---------------------------------------------------------------------------*/

void pre_auton(void) {
  // 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) {
  // ..........................................................................
  // Insert autonomous user code here.
  // ..........................................................................
}

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

void usercontrol(void) {
  // User control code here, inside the loop
  while (1) {
    // This is the main execution loop for the user control program.
    // Each time through the loop your program should update motor + servo
    // values based on feedback from the joysticks.

    // ........................................................................
    // while (1){
          Drivetrain.drive(forward);
          if(Controller1.ButtonL1.pressing()){
          ;
            Arm.spin(forward);
          }
          if(Controller1.ButtonL2.pressing()){
          ;
            Arm.spin(reverse);
          }
          if(Controller1.ButtonX.pressing()){
          ;
            Claw.spin(forward);
          }
          if(Controller1.ButtonY.pressing()){
          ;
            Claw.spin(reverse);
          }

    // ........................................................................

    wait(20, msec); // Sleep the task for a short amount of time to
                    // prevent wasted resources.
  }

//
// Main will set up the competition functions and callbacks.
//
int main();
  // Set up callbacks for autonomous and driver control periods.
  Competition.autonomous(autonomous);
  Competition.drivercontrol(usercontrol);

  // Run the pre-autonomous function.
  pre_auton();

  // Prevent main from exiting with an infinite loop.
  while (true) {
    wait(100, msec);
  }
}

There shouldn’t be any semicolons by themselves. Remove all your extra semicolons

if(Controller1.ButtonY.pressing()){
          ;
            Claw.spin(reverse);
 }

Should become

if(Controller1.ButtonY.pressing()){
            Claw.spin(reverse);
 }
1 Like

I am very bad at coding can you explain what I destroyed because im dumb thxAnnotation 2019-12-13 191731
ps my competion is tomorrow so plz help soon thx

Make sure #include “vex.h” is the first line in main.cpp

2 Likes

Annotation 2019-12-13 191731
help plz

sorry wrong screenshotAnnotation 2019-12-13 193734

Does it build? If not, zip up the project folder and send it to me.

1 Like

Annotation 2019-12-13 195352
how do I declare it ? what is it for anyway ?
thx for the help BTW

hehe
all I did was take it out and no more errors