I was having an issue when switching between Auton and Drive and back with my switch, after I switched to auton my robot display broke and the motors kept going infinitely until I stopped them and after I switched back to usercontrol nothing would happen (User control worked originally). Here is my main code :
#include"myRobot.h" // Includes My Library
using namespace vex; // Exports All of the functions and types in namespace "vex"
using namespace DisplayControls; // Exports All of the functions and types in namespace "DisplayControls"
using namespace UserControl;// Exports All of the functions and types in namespace "UserControl"
using namespace Odometry; // Exports All of the functions and types in namespace "Odometry"
using namespace Auton; // Exports Auton Functions
competition Competition; // Delcares the Competion
/******d
@brief This is what is called when the robot starts
*******/
int main() { // This is the "entry point" of the program
Inertial1.calibrate();
while(Inertial1.isCalibrating()){
wait(5,msec);
}
LF.setPosition(0,deg);
LR.setPosition(0,deg);
RF.setPosition(0,deg);
RR.setPosition(0,deg);
//thread LiftControl(LiftControls::LiftPid);
thread Temp(Utilities::TemperatureMonitor::Monitor);
thread PluggedIn(Utilities::PluggedInMonitor::Monitor);
thread MeasuringDevies(Utilities::ValueMonitor::Monitor);
thread ScissorMonitor(LiftControls::MonitorLimitSwitches);
thread LimitsInit(initAllLimits);
Competition.drivercontrol(UserControl::usercontrol);
Competition.bStopAllTasksBetweenModes = false;
Competition.bStopTasksBetweenModes = false;
Competition.autonomous(Auton::autonomous);
DisplayControls:: DisplayMain();
printf("MAJOR ERROR");
}
And I Also attached all of my code files below
TheUnknowsVer_4.0 (4).zip (5.5 MB)




