const int red1 = 4;
const int yellow1 = 3;
const int green1 = 2;
const int red2 = 7;
const int yellow2 = 6;
const int green2 = 5;
const int red3 = 10;
const int yellow3 = 9;
const int green3 = 8;
const int red4 = 13;
const int yellow4 = 12;
const int green4 = 11;
void setup() {
for(int i=2;i<=13;i++)
pinMode(i,OUTPUT);
}
void loop() {
direction(red1,yellow1,green1,red2,yellow2,green2,red3,yellow3,green3,red4,yellow4,green4);
direction(red2,yellow2,green2,red1,yellow1,green1,red3,yellow3,green3,red4,yellow4,green4);
direction(red3,yellow3,green3,red1,yellow1,green1,red2,yellow2,green2,red4,yellow4,green4);
direction(red4,yellow4,green4,red1,yellow1,green1,red2,yellow2,green2,red3,yellow3,green3);
}
void direction(int a,int b,int c,int d,int e,int f,int g,int h,int i,int j,int k,int l)
{
digitalWrite(a, LOW);
digitalWrite(b, LOW);
digitalWrite(c, HIGH);
digitalWrite(d, HIGH);
digitalWrite(e, LOW);
digitalWrite(f, LOW);
digitalWrite(g, HIGH);
digitalWrite(h, LOW);
digitalWrite(i, LOW);
digitalWrite(j, HIGH);
digitalWrite(k, LOW);
digitalWrite(l, LOW);
delay(5000);
digitalWrite(c, LOW);
digitalWrite(b, HIGH);
delay(3000);
}