I have been trying to code my robot’s drive train and four bar. I just finished, and am trying to upload it to the robot. However, whenever I try to build, the system says "make process closed with exit code : 2. I have asked everyone i know and no one can figure it out. A copy of my code is below:
#include “robot-config.h”
/---------------------------------------------------------------------------/
/* /
/ Description: Competition template for VCS VEX V5 /
/ /
/---------------------------------------------------------------------------*/
//Creates a competition object that allows access to Competition methods.
vex::competition competition;
/---------------------------------------------------------------------------/
/* 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 cortex has been powered on and /
/ not every time that the robot is disabled. /
/---------------------------------------------------------------------------*/
void pre_auton( void ) {
// 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.
// ........................................................................
// Insert user code here. This is where you use the joystick values to
// update your motors, etc.
// ........................................................................
int armspeedPCT = 50;
vex::task::sleep(20); //Sleep the task for a short amount of time to prevent wasted resources.
LeftDrive.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
RightDrive.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);
if(Controller1.ButtonR1.pressing()) { //If button R1 is pressed…
//…Spin the arm motor forward.
BarRight.spin(vex::directionType::fwd, armspeedPCT, vex::velocityUnits::pct);
BarLeft.spin(vex::directionType::fwd, armspeedPCT, vex::velocityUnits::pct);
}
else if(Controller1.ButtonR2.pressing()) { //If button R2 is pressed…
//…Spin the arm motor backward.
BarLeft.spin(vex::directionType::rev, armspeedPCT, vex::velocityUnits::pct);
BarRight.spin(vex::directionType::rev, armspeedPCT, vex::velocityUnits::pct);
}
//
// Main will set up the competition functions and callbacks.
//
int main (void); {
//Run the pre-autonomous function.
pre_auton();
//Set up callbacks for autonomous and driver control periods.
Competition.autonomous( autonomous );
Competition.drivercontrol( usercontrol );
//Prevent main from exiting with an infinite loop.
while(1) {
vex::task::sleep(100);//Sleep the task for a short amount of time to prevent wasted resources.
}
}}}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include “v5.h”
#include “v5_vcs.h”
//
using namespace vex;
vex::brain Brain;
vex::motor LeftDrive (vex::PORT11, vex::gearSetting::ratio36_1,false);
vex::motor BarLeft (vex::PORT12, vex::gearSetting::ratio36_1,false);
vex::motor BarRight (vex::PORT19, vex::gearSetting::ratio36_1,true);
vex::motor RightDrive (vex::PORT20, vex::gearSetting::ratio36_1,false);
vex::controller Controller1;
vex::competition Competition;