const int redPin=10;
const int greenPin=9;
const int yellowPin=8;
const int redDuration=5000;
const int greenDuration=2000;
const int yellowDuration=5000;
void setup() {
// put your setup code here, to run once:
pinMode(redPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
//red
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
digitalWrite(yellowPin, LOW);
delay(redDuration);
//yellow
digitalWrite(yellowPin, HIGH);
digitalWrite(greenPin, LOW);
digitalWrite(redPin, LOW);
delay(yellowDuration);
//green
digitalWrite(greenPin, HIGH);
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, LOW);
delay(greenDuration);
}