Hey, so I went to open up my competition code and for some reason the compiler said that:
File “.\Includes\Vex_Competition_Includes.c” compiled on Nov 10 2016 16:03:39
Error:No body defined for procedure prototype ‘usercontrol’
Warning:Unreferenced function ‘pre_auton’
Warning:Unreferenced function ‘UserControlCodePlaceholderForTesting’
Warning:Unreferenced function ‘AutonomousCodePlaceholderForTesting’
and I don’t know how to fix it. Can someone please help me?
void allMotorsOff();
void allTasksStop();
void pre_auton(); //error here
task autonomous();
task usercontrol(); //error here
static void AutonomousCodePlaceholderForTesting();
static void UserControlCodePlaceholderForTesting();
int nTimeXX = 0;
bool bStopTasksBetweenModes = true;
static void displayStatusAndTime();
task main()
{
// Master CPU will not let competition start until powered on for at least 2-seconds
clearLCDLine(0);
clearLCDLine(1);
displayLCDPos(0, 0);
displayNextLCDString("Startup");
wait1Msec(2000);
}
void pre_auton()
{
bStopTasksBetweenModes = true;
}
task autonomous()
{
while (true)
{
clearLCDLine(0);
clearLCDLine(1);
displayLCDPos(0, 0);
while (bIfiRobotDisabled)
{
displayLCDPos(0, 0);
displayNextLCDString("Disabled");
nTimeXX = 0;
while (true)
{
displayStatusAndTime();
if (!bIfiRobotDisabled)
break;
wait1Msec(25);
displayStatusAndTime();
if (!bIfiRobotDisabled)
break;
wait1Msec(25);
displayStatusAndTime();
if (!bIfiRobotDisabled)
break;
wait1Msec(25);
displayStatusAndTime();
if (!bIfiRobotDisabled)
break;
wait1Msec(25);
++nTimeXX;
}
}
nTimeXX = 0;
clearLCDLine(0);
clearLCDLine(1);
displayLCDPos(0, 0);
if (bIfiAutonomousMode)
{
displayNextLCDString("Autonomous");
startTask(autonomous);
// Waiting for autonomous phase to end
while (bIfiAutonomousMode && !bIfiRobotDisabled)
{
if (!bVEXNETActive)
{
if (nVexRCReceiveState == vrNoXmiters) // the transmitters are powered off!!
allMotorsOff();
}
wait1Msec(25); // Waiting for autonomous phase to end
}
allMotorsOff();
if(bStopTasksBetweenModes)
{
allTasksStop();
}
}
else
{
displayNextLCDString("User Control");
startTask(usercontrol);
// Here we repeat loop waiting for user control to end and (optionally) start
// of a new competition run
while (!bIfiAutonomousMode && !bIfiRobotDisabled)
{
if (nVexRCReceiveState == vrNoXmiters) // the transmitters are powered off!!
allMotorsOff();
wait1Msec(25);
}
allMotorsOff();
if(bStopTasksBetweenModes)
{
allTasksStop();
}
}
}
}
void allMotorsOff()
{
motor[port1] = 0;
motor[port2] = 0;
motor[port3] = 0;
motor[port4] = 0;
motor[port5] = 0;
motor[port6] = 0;
motor[port7] = 0;
motor[port8] = 0;
#if defined(VEX2)
motor[port9] = 0;
motor[port10] = 0;
#endif
}
void allTasksStop()
{
stopTask(1);
stopTask(2);
stopTask(3);
stopTask(4);
#if defined(VEX2)
stopTask(5);
stopTask(6);
stopTask(7);
stopTask(8);
stopTask(9);
stopTask(10);
stopTask(11);
stopTask(12);
stopTask(13);
stopTask(14);
stopTask(15);
stopTask(16);
stopTask(17);
stopTask(18);
stopTask(19);
#endif
}
static void displayStatusAndTime()
{
displayLCDPos(1, 0);
if (bIfiRobotDisabled)
displayNextLCDString("Disable ");
else
{
if (bIfiAutonomousMode)
displayNextLCDString("Auton ");
else
displayNextLCDString("Driver ");
}
displayNextLCDNumber(nTimeXX / 600, 2);
displayNextLCDChar(':');
displayNextLCDNumber((nTimeXX / 10) % 60, -2);
displayNextLCDChar('.');
displayNextLCDNumber(nTimeXX % 10, 1);
}
void UserControlCodePlaceholderForTesting() //error here
{
while (true)
{
// Following code is simply for initial debuggging.
//
// It can be safely removed in a real program and removing it will slightly improve the
// real-time performance of your robot.
//
displayStatusAndTime();
wait1Msec(100);
++nTimeXX;
}
}
void AutonomousCodePlaceholderForTesting() //and final error here
{
// This is where you insert your autonomous code. Because we don't have any, we'll
// simply display a running count of the time on the VEX LCD.
while (true)
{
displayStatusAndTime();
wait1Msec(100);
++nTimeXX;
}
}