Need help with coding here whats i have getting error “Executable statements not valid in ‘main’ declaration block”
Thanks in advance
Code :
#pragma config(Sensor, in1, Pot, sensorPotentiometer)
#pragma config(Motor, port1, Claw, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, LiftRA, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port3, XDriveA, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, LiftRB, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port5, XDriveB, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, LiftLA, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port7, XDriveC, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, LiftLB, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port9, XDriveD, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, Claw, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
task main()
{
while(1==1)
clearDebugStream();
//X-Drive
motor[XDriveA] = vexRT[Ch3] + vexRT[Ch1] - vexRT[Ch4];
motor[XDriveB] = vexRT[Ch3] - vexRT[Ch1] + vexRT[Ch4];
motor[XDriveC] = vexRT[Ch3] + vexRT[Ch1] + vexRT[Ch4];
motor[XDriveD] = vexRT[Ch3] - vexRT[Ch1] - vexRT[Ch4];
}
// This code is for GROUP 1.
// Members that should be coding for competetion is Sam,Justyn,Sean(Alex)
// If you dont know what you doing please ask for help from Sam or Justyn
//Lift UP
if(vexRT[Btn5U] == 1)
{
motor[LiftRA] = 127;
motor[LiftRB] = 127;
motor[LiftLA] = 127;
motor[LiftLB] = 127;
}
//Lift DOWN
else if(vexRT[Btn5D] == 1)
{
motor[LiftRA] = -127;
motor[LiftRB] = -127;
motor[LiftLA] = -127;
motor[LiftLB] = -127;
}
//Every motors in lift is set to neutral
else
{
motor[LiftRA] = 0;
motor[LiftRB] = 0;
motor[LiftLA] = 0;
motor[LiftLB] = 0;
}
if(vexRT[Btn7U] == 1) //If the button is pressed… LIFTS UP
if(SensorValue[Pot] < 900) //If the Potentiometer
{ //has not reached its maximum point…
motor[LiftLA] = 31; //turn the motor on forward.
motor[LiftLB] = 31;
motor[LiftRA] = 31;
motor[LiftRB] = 31;
}
else //If the Potentiometer has reached
//its maximum point…
{
motor[LiftLA] = 0; //turn the motor off.
motor[LiftLB] = 0;
motor[LiftRA] = 0;
motor[LiftRB] = 0;
}
if(vexRT[Btn7D] == 1) //If the button is pressed… LIFTS DOWN
{
if(SensorValue[Pot] > 550) //If the Potentiometer
//has not reached its minimum point… ///////////////////////////////////////////
motor[LiftLA] = -31; //turn the motor on in reverse. ////////Remember to check this ///////////
motor[LiftLB] = -31;
motor[LiftRA] = -31;
motor[LiftRB] = -31; /////////////////////////////////////////
}
else //If the Potentiometer has reached
{ //its minimum point…
motor[LiftLB] = 0;
motor[LiftLA] = 0;
motor[LiftRA] = 0;
motor[LiftRB] = 0;
}
}
}