//ERROR: Task 'autonomous' is not defined at global scope level
#pragma config(StandardModel, "RVW CLAWBOT")
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#pragma DebuggerWindows("joystickSimple")
task autonomous();
task main()
{
while (true)
{
// update buttons and joysticks
getJoystickSettings(joystick);
//Assign the left and right joystick values
//to the left and right motors
motor[leftMotor] = joystick.joy1_y1;
motor[rightMotor] = joystick.joy1_y1;
task autonomous()
{
motor[leftMotor] = 80;
motor[rightMotor] = 80;
wait1Msec(2500);
motor[leftMotor] = 0;
motor[rightMotor] = 0;
wait1Msec(1000);
motor[leftMotor] = 80;
motor[rightMotor] = -80;
wait1Msec(2500);
motor[leftMotor] = 0;
motor[rightMotor] = 0;
}
if(motor[rightMotor] == 1) {
startTask(autonomous);
stopTask(main);
}
}
}