Click here to Skip to main content
16,009,598 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
int redl = 10;

int yellowl = 9;

int greenl = 8;

int red2 = 12;

int green = 11;

void setup();

'('

pinMode (redl, OUTPUT) ;

'('


pinMode(yellowl, OUTPUT) ;

'('


pinMode(greenl, OUTPUT) ;

'('


pinMode(red2, OUTPUT) ;

'('

pinMode(green2, OUTPUT) ;

}

void loop();

'voidchangeLights' int ';'

delay(1000)


void changeLights() { ;

digitalWrite(greenl, Low);

digitalWrite(yellow, HIGH);

digitalWrite(red2, HIGH);

delay(4000) ;

// turn yellow off, and oppposite green and red

digitalWrite(yellowl, LOW) ;

digitalWrite(redl, HIGH) ;

digitalWrite(red2, LOW) ;

digitalWrite(green2, HIGH) ;

delay(50000) ;

digitalWrite(green2, LOW) ;

digitalWrite(red, LOW) ;

digitalWrite(greenl, HIGH) ;

digitalWrite(red2, HIGH)

delay(5000) ;

digitalWrite(greenl, LOW) ;

digitalWrite(yellowl, HIGH) ;

digitalWrite(redl, LOW) ;

digitalWrite(red2, HIGH) ;

delay(1000) ;


'{'

What I have tried:

Having a problem in coding
Traffic light project
Pls solve
Posted
Updated 18-Apr-22 20:10pm

You have to get rid of all the syntax errors of your code. Start with the skeleton sketch provided by the Arduino IDE and add just one LED. Once you have a fully working program handling that one LED, you might start to add more LEDs and functionalities.
 
Share this answer
 
You should start at the central tutorial site for arduino.
Take the time to learn from some examples and get involved in the arduino community to get special insights.

Good luck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900