I have attempted to make a very basic Tank Drive program but have ran in to the following error.
16:37:07 – error – In file included from cxx_entry.cpp:7:
…/vexv5/gcc/include\stdlib.h:20:10: fatal error: ‘machine/stdlib.h’ file not found
#include
Is there anyone that has experienced this error before. I have copied and pasted the code below
#include "robot-config.h"
vex::competition Competition;
void pre_auton( void ) {
}
void autonomous( void ) {
}
void usercontrol( void ) {
// User control code here, inside the loop
while(true){
//Tank Drive
Frontleftwheel.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct),velocityUnits::pct);
Backleftwheel.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct),velocityUnits::pct);
Frontrightwheel.spin(directionType::fwd,Controller1.Axis2.position(percentUnits::pct),velocityUnits::pct);
Backrightwheel.spin(directionType::fwd,Controller1.Axis2.position(percentUnits::pct),velocityUnits::pct);
if(Controller1.ButtonL1.pressing()) // Use L1 to Lift the Arm
{
Leftlift.spin(directionType::fwd,50,velocityUnits::pct);
Rightlift.spin(directionType::fwd,50,velocityUnits::pct);
}
else if(Controller1.ButtonL2.pressing()) //Use L2 to Lower Arm
{
Leftlift.spin(directionType::rev,30,velocityUnits::pct);
Rightlift.spin(directionType::rev,30,velocityUnits::pct);
}
else // holds arm
{
Leftlift.stop(brakeType::hold)
Rightlift.stop(brakeType::hold)
}
if(Controller1.ButtonR1.pressing()) // suck it up
{
Leftintake.spin(directionType::fwd,50,velocityUnits::pct);
RightIntake.spin(directionType::fwd,50,velocityUnits::pct);
}
else if(Controller1.ButtonR2.pressing()) //spit it out
{
Leftintake.spin(directionType::rev,20,velocityUnits::pct);
RightIntake.spin(directionType::rev,20,velocityUnits::pct);
}
else // holds arm
{Leftintake.stop(brakeType::hold)
RightIntake.stop(brakeType::hold)
}
vex::task::sleep(20); //Sleep the task for a short amount of time to prevent wasted resources.
}
}
int main() {
//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.
}
}