#define RojoI 15
#define AmarilloI 2
#define VerdeI 4
#define VerdeII 14
#define AmarilloII 12
#define RojoII 13
#define VerdeIII 23
#define AmarilloIII 22
#define RojoIII 21
#define VerdeIV 25
#define AmarilloIV 26
#define RojoIV 27
int contar= 2147483645;
void setup() {
Serial.begin(115200);
Serial.println("Semaforo");
pinMode(AmarilloI, OUTPUT); //Amarillo I
pinMode(RojoI, OUTPUT); //Rojo I
pinMode(VerdeI, OUTPUT); //Verde I
pinMode(VerdeII, OUTPUT); //Verde II
pinMode(AmarilloII, OUTPUT); //Amerillo II
pinMode(RojoII, OUTPUT); //Rojo II
pinMode(VerdeIII, OUTPUT); //Verde III
pinMode(AmarilloIII, OUTPUT); //Amerillo III
pinMode(RojoIII, OUTPUT); //Rojo III
pinMode(VerdeIV, OUTPUT); //Verde IV
pinMode(AmarilloIV, OUTPUT); //Amerillo IV
pinMode(RojoIV, OUTPUT); //Rojo IV
}
void loop() {
digitalWrite(4, HIGH);
digitalWrite(2, LOW);
digitalWrite(15, LOW);
digitalWrite(13, HIGH);
digitalWrite(12, LOW);
digitalWrite(14, LOW);
digitalWrite(21, HIGH);
digitalWrite(22, LOW);
digitalWrite(23, LOW);
digitalWrite(25, HIGH);
digitalWrite(26, LOW);
digitalWrite(27, LOW);
delay(10000);
digitalWrite(2, HIGH);
digitalWrite(15, LOW);
digitalWrite(VerdeI, LOW);
digitalWrite(26, HIGH);
digitalWrite(27, LOW);
digitalWrite(25, LOW);
delay(5000);
digitalWrite(RojoI, HIGH);
digitalWrite(2, LOW);
digitalWrite(VerdeI, LOW);
digitalWrite(14, HIGH);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
digitalWrite(23, HIGH);
digitalWrite(22, LOW);
digitalWrite(21, LOW);
digitalWrite(27, HIGH);
digitalWrite(26, LOW);
digitalWrite(25, LOW);
delay(10000);
digitalWrite(12, HIGH);
digitalWrite(13, LOW);
digitalWrite(14, LOW);
digitalWrite(22, HIGH);
digitalWrite(23, LOW);
digitalWrite(21, LOW);
delay(5000);
contar = contar +1;
Serial.print("Numero de ciclo: ");
Serial.println(contar);
}