Why do I get an error message?

Hey!
I’m very new to Arduino and this is only like my fourth project or so and I’m very confused, I’m trying to make a traffic light simulator and everything in the code seems to be right but apparently not since I’m getting this error message:

Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: “Arduino/Genuino Uno”

In file included from sketch\sketch_oct16a.ino.cpp:1:0:

C:\Users*MY NAME*\Documents\Arduino\sketch_oct16a\sketch_oct16a.ino: In function ‘void changeLights()’:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:40:14: error: expected unqualified-id before numeric constant

#define HIGH 0x1

^

C:\Users*MY NAME*\Documents\Arduino\sketch_oct16a\sketch_oct16a.ino:33:24: note: in expansion of macro ‘HIGH’

digitalWrite(carRed. HIGH);

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:40:14: error: expected unqualified-id before numeric constant

#define HIGH 0x1

^

C:\Users*MY NAME*\Documents\Arduino\sketch_oct16a\sketch_oct16a.ino:47:25: note: in expansion of macro ‘HIGH’

digitalWrite(carYellow. HIGH);

^

exit status 1
Error compiling for board Arduino/Genuino Uno.

I really don’t know what’s wrong with my code, here it is:

int carRed = 12;
int carYellow = 11;
int carGreen = 10;
int button = 9;
int pedRed = 8;
int pedGreen = 7;
int crossTime = 5000;
long changeTime;

void setup() {

pinMode(carRed, OUTPUT);
pinMode(carYellow, OUTPUT);
pinMode(carGreen, OUTPUT);
pinMode(button, INPUT);
pinMode(pedRed, OUTPUT);
pinMode(pedGreen, OUTPUT);
digitalWrite(carGreen, HIGH);
digitalWrite(pedRed, HIGH); }

void loop() {
int state = digitalRead(button);

if(state == HIGH && (millis() - changeTime)> 5000) { changeLights(); }
}

void changeLights() {

digitalWrite(carGreen, LOW);
digitalWrite(carYellow, HIGH);
delay(2000);
digitalWrite(carYellow, LOW);
digitalWrite(carRed. HIGH);
delay(1000);
digitalWrite(pedRed, LOW);
digitalWrite(pedGreen, HIGH);
delay(crossTime);
for (int x=0; x<10; x++){
digitalWrite(pedGreen, HIGH);
delay(250);
digitalWrite(pedGreen, LOW);
delay(250);
}
digitalWrite(pedRed, HIGH);
delay(500);
digitalWrite(carRed, LOW);
digitalWrite(carYellow. HIGH);
delay(1000);
digitalWrite(carYellow, LOW);
digitalWrite(carGreen, HIGH);
changeTime = millis();
}

An answer would be very appreciated! :slight_smile:

Can you see the difference between this . and this , ?

I can now, thank you very much!