I just wrote an Arduino program, but I keep receiving the following error:
"Expected Unqualified-Id Before ')' Token"
I've tried removing chunks of code and recompiling, but regardless of what code I remove, I still get this error, with one of the first 4 lines highlighted with the error. Here's my code:
const int ledCharge1 = 8;
const int ledCharge2 = 9;
const int ledCharge3 = 10;
const int ledRun = 13;
const int modeInLocal = 2;
const int modeInAuto = 3;
const int inStart = 5;
const int inStop = 6;
const int localState = 0;
int i = 0;
void setup() {
pinMode(ledCharge1, OUTPUT);
pinMode(ledCharge2, OUTPUT);
pinMode(ledCharge3, OUTPUT);
pinMode(ledRun, OUTPUT);
pinMode(modeInLocal, INPUT);
pinMode(modeInAuto, INPUT);
pinMode(inStart, INPUT);
pinMode(inStop, INPUT);
}
void loop() {
int localState = digitalRead(modeInLocal);
if (localState == LOW) {
local;
}
int autoState = digitalRead(modeInAuto);
if (autoState == LOW) {
auto;
}
if (localState == HIGH && autoState == HIGH) {
digitalWrite(ledCharge1, LOW);
digitalWrite(ledCharge2, LOW);
digitalWrite(ledCharge3, LOW);
digitalWrite(ledRun, LOW);
}
}
void auto() {
for (int i = 0; i < 3; i++) {
digitalWrite(ledCharge1, HIGH);
delay(750);
digitalWrite(ledCharge1, LOW);
delay(750);
}
digitalWrite(ledCharge1, HIGH);
for (int i = 0; i < 3; i++) {
digitalWrite(ledCharge2, HIGH);
delay(750);
digitalWrite(ledCharge2, LOW);
delay(750);
}
digitalWrite(ledCharge2, HIGH);
for (int i = 0; i < 3; i++) {
digitalWrite(ledCharge3, HIGH);
delay(750);
digitalWrite(ledCharge3, LOW);
delay(750);
}
digitalWrite(ledCharge3, HIGH);
digitalWrite(ledRun, HIGH);
for (int i = 0; i < 5; i++) {
digitalWrite(ledCharge3, HIGH);
delay(750);
digitalWrite(ledCharge3, LOW);
delay(750);
}
for (int i = 0; i < 5; i++) {
digitalWrite(ledCharge2, HIGH);
delay(750);
digitalWrite(ledCharge2, LOW);
delay(750);
}
for (int i = 0; i < 3; i++) {
digitalWrite(ledCharge1, HIGH);
delay(750);
digitalWrite(ledCharge1, LOW);
delay(750);
}
digitalWrite(ledRun, LOW);
}
Like I said, it's always one of the first 4 lines, even when I remove the first half of the program (or any chunk of it, for that matter) and try again. What's happening?
Oh, also, there's one function I haven't put in yet. (You may notice a reference to it in the "loop" function.) I just want to get this sorted out before I finish it up and have more possible errors to worry about.