this my code:
void auton20PointRed() {
//pidGoal = 600;
MoveDrive(85,85,1350);//1.Drive forward and drop the Mogo lift then wait for half a second
// wait10Msec(50);
//pidGoal = 2500;//2.Pick up the Mogo lift turn then wait half a second
wait10Msec (90);
MoveDrive (-60,-60,600);// back out of cones
wait10Msec (10);
MoveDrive(115,-115,480); //turn around with mogo
wait10Msec(30);
MoveDrive(100,100,370); //move to infront of starting bar
wait10Msec(20);
MoveDrive (60,-60,135); //turn toward 20 point
wait10Msec (20);
MoveDrive (90,90,1100);//move to 20 point zone
//pidGoal = 600;//drop mogo in 20 point zone
wait10Msec (60);
MoveDrive (-115,-115,300);//back up
// pidGoal =1000;
wait10Msec (10);
MoveDrive (115, 115,300);
wait10Msec (10);
MoveDrive(-115,-115,600);//back out of 10 point zone
}
here are my errors:
Error:Expected->‘Identifier’. Found ‘Numeric’
Error:Unexpected ‘20’ during parsing
Warning:Undefined procedure ‘PointAutonRed’. Global subroutine assumed.
Error:Missing ‘;’ before ‘{’
Error:Executable statements not valid in ‘main’ declaration block
Error:Duplicate definition for task ‘main’.
can u help?
but now it s telling me that I have multiple definitions for task main need help fixing that ,( :
Can you post all of the code? The function you posted looks fine to me, but I am not an expert. Most of those errors are not talking about this section of the code, from what i can tell.
sorry about the confusion earlier I got some of it solved but now it is just this last part ( :
this is the full code:
void MoveDrive(int LeftMotorSpeed, int RightMotorSpeed, int rightDrive)
{
SensorValue[rightDrive] = 0;
while(abs(SensorValue[I2C_1]) < 1200)
{
motor[frontRightDrive] = RightMotorSpeed;
motor[rearRightDrive] = RightMotorSpeed;
motor[frontLeftDrive] = LeftMotorSpeed;
motor[rearLeftDrive] = LeftMotorSpeed;
}
motor[frontRightDrive] = 0;
motor[rearRightDrive] = 0;
motor[frontLeftDrive] = 0;
motor[rearLeftDrive] = 0;
}
void auton20PointRed();
{
MoveDrive(85,85,1350);//1.Drive forward and drop the Mogo lift then wait for half a second
//2.Pick up the Mogo lift turn then wait half a second
wait10Msec (90);
MoveDrive (-60,-60,600);// back out of cones
wait10Msec (10);
MoveDrive(115,-115,480); //turn around with mogo
wait10Msec(30);
MoveDrive(100,100,370); //move to infront of starting bar
wait10Msec(20);
MoveDrive (60,-60,135); //turn toward 20 point
wait10Msec (20);
MoveDrive (90,90,1100);//move to 20 point zone
//drop mogo in 20 point zone
wait10Msec (60);
MoveDrive (-115,-115,300);//back up
wait10Msec (10);
MoveDrive (115, 115,300);
wait10Msec (10);
MoveDrive(-115,-115,600);//back out of 10 point zone
}
well there is no task main, so that is a problem
And you never call the function to run, which would have to be in the task main