Traffic Lights

By |2019-11-04T15:48:21+00:004th November 2019|Arduino|

Code for the Arduino: int ledRed = 13; int ledAmber = 12; int ledGreen = 11; void setup() {   pinMode(ledRed, OUTPUT);   pinMode(ledAmber, OUTPUT);   pinMode(ledGreen, OUTPUT);   digitalWrite(ledAmber, LOW);   digitalWrite(ledGreen, LOW);   digitalWrite(ledRed, LOW); } void loop() {   digitalWrite(ledRed, HIGH);   digitalWrite(ledAmber, LOW);    digitalWrite(ledGreen, LOW);   delay(3000);     digitalWrite(ledRed, HIGH);   digitalWrite(ledAmber, HIGH);   digitalWrite(ledGreen, LOW);   delay(1000);   digitalWrite(ledGreen, HIGH);   digitalWrite(ledRed, LOW);     digitalWrite(ledAmber, LOW);   delay(3000);   digitalWrite(ledAmber, HIGH); [...]