Vom simula un semafor format din 3 LED-uri: verde, galben și roșu.
Link:
https://www.tinkercad.com/things/3nNf3i1tBtU-02-led
void setup() {
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(3000);
digitalWrite(12, HIGH);
delay(2000);
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay(3000);
digitalWrite(12, HIGH);
delay(2000);
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(13, HIGH);
delay(3000);
}