void setup()
{
for(int i=2;i<=7;i++){
pinMode(i, OUTPUT);
}
}
void traffic( int R1,int Y1, int G1, int R2, int Y2, int G2){
digitalWrite(2,R1);
digitalWrite(3,Y1);
digitalWrite(4,G1);
digitalWrite(5,R2);
digitalWrite(6,Y2);
digitalWrite(7,G2);
}
void loop()
{
// Step 1
traffic(1,0,0,0,0,1);
delay(15000);
// Step 2
traffic(1,0,0,0,1,0);
delay(5000);
// Step 3
traffic(0,0,1,1,0,0);
delay(15000);
// Step 4
traffic(0,1,0,1,0,0);
delay(5000);
}