I get an error at 'changeLights();' in the void loop. I'm new to arduino and I really can't figure out why this is happening
Code:
int red = 10;
int yellow = 9;
int green = 8;
int button = 12;
void setup(){
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
pinMode(button, INPUT);
digitalWrite(green, HIGH);
}
void loop(){
if(digitalRead(button) == HIGH) {
delay(15);
if(digitalRead(button) == HIGH) (
changeLights();
delay(15000);
)
}
}
void changeLights(){
// green off, yellow on for 3 seconds
digitalWrite(green, HIGH);
digitalWrite(yellow, LOW);
delay(3000);
// turn off yellow, then turn red on for 5 seconds
digitalWrite(yellow, HIGH);
digitalWrite(red, LOW);
delay(5000);
// red and yellow on for 2 seconds (red is already on though)
digitalWrite(yellow, LOW);
delay(2000);
// turn off red and yellow, then turn on green
digitalWrite(yellow, HIGH);
digitalWrite(red, HIGH);
digitalWrite(green, LOW);
delay(3000);
}