VEX Code V5: make process closed with exit code : 2

Does anyone know what this error means?

yes, it means that it is not working

But… what is the cause behind the error?

are you using the latest version of vexcode?
I believe this was an issue with some of the past versions

I’m actually not sure. Can you send me a link to the latest version?

I have version 0.9 and still have this error.

Sure: https://www.vexrobotics.com/vexcode-download

Alright, I redownloaded and everything but it still isn’t working. It has the same error

try downloading a program you know works, like a sample program. this way you can narrow down whether the issue is your code or not.

Hmm, it did indeed build this time without the error.

what did, the sample program, or your original program?
if the sample program went fine and your program didn’t, then post your code here so we can try and spot an issue.

The sample program. One second, I will post the code.

#include "robotConfig.h"

#include “vex.h”

//Declares the three FilteredValue variables.

double axis3FV = 0;
double axis4FV = 0;
double axis1FV = 0;

int threshold = 7;

//Logic and computation for driving.
int drivetrain()
{
while (true)
{
//Variable that stores the position of the arm
double armPosition = armMotor.rotation(vex::rotationUnits::deg);

double theXVariable = pow((armPosition - 720), 2); 

	//Equation of the parabola which determines y (the filtered joystick values) given x (the arm position)
	double speedDetermination = (1 / 6480 * theXVariable + 20) / 100;

	//Determines the filtered value of Axis3; if the value is higher than the sensitivity threshold, it will be multiplied against the speed limit (based on the position of the arm) and sent to the calculation matrix.
	if (abs(Controller.Axis3.position(vex::percentUnits::pct)) > threshold)
	{
		axis3FV = Controller.Axis3.position(vex::percentUnits::pct) * speedDetermination;
	}

    //If the above condition is not true, the variable will be set to the default 0
	else
	{
		axis3FV = 0;
	}

	//Determines the filtered value of Axis4; if the value is higher than the sensitivity threshold, it will be multiplied against the speed limit (based on the position of the arm) and sent to the calculation matrix.
	if (abs(Controller.Axis4.position(vex::percentUnits::pct)) > threshold)
	{
		axis4FV = Controller.Axis4.position(vex::percentUnits::pct) * speedDetermination;
	}

//If the above condition is not true, the variable will be set to the default 0
	else
	{
		axis4FV = 0;
	}

	//Determines the filtered value of Axis1; if the value is higher than the sensitivity threshold, it will be multiplied against the speed limit (based on the position of the arm) and sent to the calculation matrix.
	if (abs(Controller.Axis1.position(vex::percentUnits::pct)) > threshold)
	{
		axis1FV = Controller.Axis1.position(vex::percentUnits::pct) * speedDetermination;
	}

    //If the above condition is not true, the variable will be set to the default 0
	else
	{
		axis1FV = 0;
	}

	//Takes the Filtered Values of Axis3, Axis4, and Axis1 and translates them into Mecannem movement 
	LFDrive.spin(vex::directionType::fwd, axis3FV + axis4FV + axis1FV, vex::velocityUnits::pct);
	RFDrive.spin(vex::directionType::fwd, axis3FV - axis4FV - axis1FV, vex::velocityUnits::pct);
	LBDrive.spin(vex::directionType::fwd, axis3FV + axis4FV - axis1FV, vex::velocityUnits::pct);
	RBDrive.spin(vex::directionType::fwd, axis3FV - axis4FV + axis1FV, vex::velocityUnits::pct);
}
return (0);

}

//Controls the movement of the two intake motors, the ones that push the cube up the ramp.
int intaking()
{
while (true)
{
//If ButtonR1 is being pressed, the intakes will activate in CounterClockwise motion
if (Controller.ButtonR1.pressing())
{
intakeMotor1.spin(vex::directionType::fwd, 50, vex::velocityUnits::pct);
intakeMotor2.spin(vex::directionType::rev, 50, vex::velocityUnits::pct);
}

	//If ButtonL1 is being pressed, the intakes will activate in Clockwise motion
	else if (Controller.ButtonL1.pressing())
	{
		intakeMotor1.spin(vex::directionType::rev, 50, vex::velocityUnits::pct);
		intakeMotor2.spin(vex::directionType::fwd, 50, vex::velocityUnits::pct);
	}

	//If none of those conditions are true, the intakes will HALT
	else
	{
		intakeMotor1.spin(vex::directionType::rev, 0, vex::velocityUnits::pct);
		intakeMotor2.spin(vex::directionType::fwd, 0, vex::velocityUnits::pct);
	}
}
return (0);

}

//Controls the movement of the Two Bar Lift
int twoBarLift()
{
while (true)
{
//If ButtonR2 is being pressed, and the position of the arm is not too high, it will move up.
if (Controller.ButtonR2.pressing() && (armMotor.rotation(vex::rotationUnits::deg) <= -122))
{
armMotor.spin(vex::directionType::fwd, 30, vex::velocityUnits::pct);
}

	//If ButtonL2 is being pressed, and the position of the arm is not too low, the arm will go down.
	else if (Controller.ButtonL2.pressing() && (armMotor.rotation(vex::rotationUnits::deg) >= -720))
	{
		armMotor.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
	}

	//If none of the conditions are met, then the arm will be stagnant.
	else
	{
		armMotor.spin(vex::directionType::rev, 0, vex::velocityUnits::pct);
		armMotor.stop(vex::brakeType::hold);
	}
}
return (0);

}

//A hotkey task that straightens the ramp automatically
int straightenRamp()
{
while (true)
{
//If ButtonUp is pressed, the ramp will go to a maximum straight position.
if (Controller.ButtonUp.pressing())
{
heavyLiftingMotor.rotateTo(1030, vex::rotationUnits::deg, 50, vex::velocityUnits::pct); //check the exact number. Ask thorstant for help if needed or tony
}

	//If ButtonDown is pressed, the ramp will go to a minimum straight position.
	else if (Controller.ButtonDown.pressing())
	{
		heavyLiftingMotor.rotateTo(0, vex::rotationUnits::deg, 50, vex::velocityUnits::pct); //check the exact number. Ask thorstant for help if needed or tony
	}

	//If none of these are true, the lifter will halt.
	else
	{
		heavyLiftingMotor.stop(vex::brakeType::coast);
	}
}
return 0;

}

//Declares all functions above as tasks and starts them.
int taskStarter()
{
vex::task twoBarLiftT(twoBarLift);
vex::task straightenT(straightenRamp);
vex::task intakingT(intaking);
vex::task drivetrainT(drivetrain);

return 0;

}

looks to me like you have other errors in your program, which would explain why it doesn’t properly compile.
Now, I may be completely overlooking something or getting this really wrong, as I’m not in any way an experienced coder, but you appear to be missing your global definitions of motors and such.
things like

vex::controller  Controller = vex::controller();

or

vex::motor LeftFrontMotor = vex::motor(vex::PORT1);

and things like

using namespace vex;

now, I see you have something that says

#include "robotConfig.h"

I know absolutely nothing about what this does, but I suspect it might be letting you configure all your motors and such in another place. if this is the case, and you aren’t missing such configurations, then I’m afraid I can’t help.

Hmm. I don’t have the using namespace vex statement, I instead have #include “vex.h”. I will try putting that in and seeing if it works. And, yes, all the motors and such are declared in robotConfig.h. Thank you so much for your time!

1 Like

may I inquire how you make separate files for things like your robotConfig.h?

Separate files as in?

Oh, I just right click on include and click new file, then format it as a header file. Then, I reference it in the src file

woah, that’s pretty cool. thanks!

Yep, for sure. Oh, by the way, here’s the full error. This is probably a lost cause, but before I move to some other coding software maybe this can be salvaged.
image