I keep getting compile errors when setting up tasks in the competition template. The following code works just fine without the template. Could someone help me figure out where to set up the tasks in the template? Much appreciated.
task drive () //driving program to run parallel to lifting and delivering
{
while (1==1)
{
motor[rightMotor] = (vexRT[Ch2]);
motor[leftMotor] = (vexRT[Ch3]);
}
}
task conveyer() /*task conveyor runs the conveyor belt when button 6U is
pressed and runs backwards when 6D is pressed*/
{
while (1==1)
{
while (vexRT[Btn6U]==1)
{
startMotor(conv1, 127);
startMotor(conv2, 127);
}
while (vexRT[Btn6D]==1)
{
startMotor(conv1, -127);
startMotor(conv2, -127);
}
stopMotor(conv1);
stopMotor(conv2);
}
}
task main() //task main is the lifting program
{
StartTask (drive);
StartTask (conveyer);
SensorValue[encoder] = 0;
while(1==1)
{
while(vexRT[Btn5U] == 1) //high goal
{
if(SensorValue[encoder]<=1200) //holding pattern for high goal
{
startMotor(lift1,127);
startMotor(lift2, 127);
}
else
{
stopMotor(lift1);
stopMotor(lift2);
}
}
while(vexRT[Btn7U] == 1) //go to medium goal
{
if(SensorValue[encoder]<=800) //holding pattern for medium goal
{
startMotor(lift1,127);
startMotor(lift2, 127);
}
else
{
stopMotor(lift1);
stopMotor(lift2);
}
}
while(vexRT[Btn7L] == 1) //go to low goal
{
if(SensorValue[encoder]<=360) //holding pattern for high goall
{
startMotor(lift1,127);
startMotor(lift2,127);
}
else
{
stopMotor(lift1);
stopMotor(lift2);
}
}
while (vexRT[Btn5D] == 1) //lower the lift
{
startMotor(lift1, -50);
startMotor(lift2, -50);
SensorValue[encoder] = 0;
}
stopMotor(lift1);
stopMotor(lift2);
SensorValue[encoder] = 0;
} //end of forever loop
} //end of task main