Flawededge
Rookie
Joined: Wed Aug 22, 2012 11:39 pm Posts: 1
|
 Noob code (need help with fixing error)
#pragma config(Motor, port2, frontRightMotor, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port3, backRightMotor, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port4, frontLeftMotor, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port5, backLeftMotor, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port6, middleMotor, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port7, SpinnyThing, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port8, QuadBelt1, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port9, QuadBelt2, tmotorServoContinuousRotation, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main() { while (1 == 1) { motor[backLeftMotor] = vexRT[Ch3]; motor[backRightMotor] = vexRT[Ch3]; motor[frontLeftMotor] = vexRT[Ch3]; motor[frontRightMotor] = vexRT[Ch3];
motor[middleMotor] = vexRT[Ch4];
motor[backLeftMotor] = vexRT[Ch1]; motor[frontLeftMotor] = vexRT[Ch1]; motor[backRightMotor] =- vexRT[Ch1]; motor[frontRightMotor] =- vexRT[Ch1]; } ------------ while(true) { if (vexRT[Btn7U] == 1) { motor[SpinnyThing] = 127; motor[QuadBelt1] = 127; motor[QuadBelt2] = 127; } else if (vexRT[Btn7D] == 1) { motor[SpinnyThing] =- 127; motor[QuadBelt1] =- 127; motor[QuadBelt2] =- 127; } else { motor[SpinnyThing] = 0; motor[QuadBelt1] = 0; motor[QuadBelt2] = 0; } }
**Error**:Variable 'true' is subsequently used as a procedure **Error**:Ummatched left brace '{' **Error**:Expected->'}'. Found 'EOF'
The top and bottom brace are giving errors =( Could someone tell me what to do, or any improvements that i could do to the code
With the dashes, i'm kinda showing the break between the joystick and the buttons
|
JohnWatson
Site Admin
Joined: Thu May 24, 2012 12:15 pm Posts: 722
|
 Re: Noob code (need help with fixing error)
**Error**:Ummatched left brace '{' **Error**:Expected->'}'. Found 'EOF'
These two are key. It's telling you that you are missing an end brace '}' somewhere in the code (meaning, there is an unmatched left brace, "{"). If we look through we see the while loop does not have a closing brace on it at all. If you put one in after the last else statement, it should work.
_________________Check out our Blog! And our Facebook page! Need help? Take a look at our updated help documentation and the ROBOTC Forums.
|