I am trying to figure out why I am getting an error in VEX Code Pro. I am in VEX VRC. Can someone look over my code? I am getting the error “[error]: make process closed with exit code : 2”
#include "vex.h"
using namespace vex;
using signature = vision::signature;
using code = vision::code;
// A global instance of brain used for printing to the V5 Brain screen
brain Brain;
// VEXcode device constructors
motor leftMotorA = motor(PORT1, ratio18_1, false);
motor leftMotorB = motor(PORT2, ratio18_1, false);
motor leftMotorC = motor(PORT3, ratio18_1, false);
motor_group LeftDriveSmart = motor_group(leftMotorA, leftMotorB, leftMotorC);
motor rightMotorA = motor(PORT6, ratio18_1, true);
motor rightMotorB = motor(PORT7, ratio18_1, true);
motor rightMotorC = motor(PORT10, ratio18_1, true);
motor_group RightDriveSmart = motor_group(rightMotorA, rightMotorB, rightMotorC);
drivetrain Drivetrain = drivetrain(LeftDriveSmart, RightDriveSmart, 319.19, 295, 40, mm, 1);
motor lift = motor(PORT5, ratio36_1, true);
motor intake2 = motor(PORT11, ratio18_1, true);
digital_out Pneumatic1 = digital_out(Brain.ThreeWirePort.A);
controller Controller1 = controller(primary);
// VEXcode generated functions
bool RemoteControlCodeEnabled = true;
// define variables used for controlling motors based on controller inputs
bool DrivetrainLNeedsToBeStopped_Controller1 = true;
bool DrivetrainRNeedsToBeStopped_Controller1 = true;
// Autonomous function
int onauton_autonomous_0() {
Brain.Screen.print("Autonomous starting..."); // Debug print
Drivetrain.driveFor(forward, 10.0, mm, true);
Brain.Screen.print("Autonomous completed."); // Debug print
return 0;
}
// define a task that will handle monitoring inputs from Controller1
int rc_auto_loop_function_Controller1() {
// process the controller input every 20 milliseconds
// update the motors based on the input values
while(true) {
if(RemoteControlCodeEnabled) {
if (Controller1.ButtonL1.pressing()) {
lift.spin(reverse);
} else if (Controller1.ButtonL2.pressing()) {
lift.spin(forward);
} else {
lift.stop();
}
if (Controller1.ButtonR1.pressing()) {
intake2.setVelocity(70, velocityUnits::pct);
intake2.spin(reverse);
} else if (Controller1.ButtonR2.pressing()) {
intake2.spin(forward);
} else {
intake2.stop();
}
// Pneumatics
if (Controller1.ButtonUp.pressing()) {
Pneumatic1.set(true);
} else if (Controller1.ButtonDown.pressing()) {
Pneumatic1.set(false);
}
// calculate the drivetrain motor velocities from the controller joystick axies
int drivetrainLeftSideSpeed = Controller1.Axis3.position() + Controller1.Axis1.position();
int drivetrainRightSideSpeed = Controller1.Axis3.position() - Controller1.Axis1.position();
// check if the value is inside of the deadband range
if (drivetrainLeftSideSpeed < 5 && drivetrainLeftSideSpeed > -5) {
LeftDriveSmart.stop();
} else {
LeftDriveSmart.setVelocity(drivetrainLeftSideSpeed, percent);
LeftDriveSmart.spin(forward);
}
if (drivetrainRightSideSpeed < 5 && drivetrainRightSideSpeed > -5) {
RightDriveSmart.stop();
} else {
RightDriveSmart.setVelocity(drivetrainRightSideSpeed, percent);
RightDriveSmart.spin(forward);
}
}
// wait before repeating the process
wait(20, msec);
}
return 0;
}
/**
* Used to initialize code/tasks/devices added using tools in VEXcode Pro.
*
* This should be called at the start of your int main function.
*/
void vexcodeInit(void) {
task rc_auto_loop_task_Controller1(rc_auto_loop_function_Controller1);
}
int main() {
vexcodeInit();
// Run autonomous
onauton_autonomous_0();
// Code to run during driver control
while (true) {
// Your driver control code here
wait(20, msec);
}
}