Whenever I try to build this new code, I get this error: [error]: make process closed with exit code : 2. Can anyone tell me why? Here is the code:
#include "vex.h"
using namespace vex;
competition Competition;
void wait(float mSec){
vex::task::sleep(mSec);
}
//Drive A
int driveControlTask(){
while (Competition.isAutonomous()!=1){
LeftDrive.spin(vex::directionType::fwd, (Controller1.Axis4.value() * .5) + Controller1.Axis3.value() +
Controller1.Axis1.value(), vex::velocityUnits::pct);
RightDrive.spin(vex::directionType::fwd, (Controller1.Axis4.value() * -.5) + Controller1.Axis3.value() -
Controller1.Axis1.value(), vex::velocityUnits::pct);
BackDrive.spin(vex::directionType::fwd, (Controller1.Axis4.value() * -1) +
Controller1.Axis1.value(), vex::velocityUnits::pct);
wait(20, msec);
} return(0);
}
//Pre-Autonomous
void pre_auton(void) {
vexcodeInit();
}
//Autonomous
void autonomous(void) {
}
//Drive B
void usercontrol(void) {
vex::task driveControl(driveControlTask);
Controller1.rumble(rumbleShort);
int intakeSpeedpct = 100;
BottomSnail.setVelocity(100, percent);
TopSnail.setVelocity(100, percent);
while(1){
if(Controller1.ButtonL2.pressing()) {
TopSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct),
BottomSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct);
}
else if(Controller1.ButtonL1.pressing()) {
BottomSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct);
}
else if(Controller1.ButtonX.pressing()) {
TopSnail.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct),
BottomSnail.spin(vex::directionType::rev, intakeSpeedpct, vex::velocityUnits::pct);
}
else{
BottomSnail.stop(brake),
TopSnail.stop(brake);
}
if(Controller1.ButtonR2.pressing()) {
LeftIntake.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct),
RightIntake.spin(vex::directionType::fwd, intakeSpeedpct, vex::velocityUnits::pct);
}
else if(Controller1.ButtonR1.pressing()) {
LeftIntake.spin(vex::directionType::rev, intakeSpeedpct, vex::velocityUnits::pct),
RightIntake.spin(vex::directionType::rev, intakeSpeedpct, vex::velocityUnits::pct);
}
else{
LeftIntake.stop(brake),
RightIntake.stop(brake);
}
wait(20, msec);
}
}
//Callbacks
int main() {
Competition.autonomous(autonomous);
Competition.drivercontrol(usercontrol);
pre_auton();
while (true) {
wait(100, msec);
}
}