/* BLINKING LEDs */
#define RED_LED_PIN 2
#define GRN_LED_PIN 8
#define BLU_LED_PIN 13
#define DELAY 250
int i=0; //Variabile contatore
void setup() {
pinMode(RED_LED_PIN, OUTPUT);
pinMode(GRN_LED_PIN, OUTPUT);
pinMode(BLU_LED_PIN, OUTPUT);
}
void loop() {
if (i<5) {
digitalWrite(RED_LED_PIN, HIGH);
delay(DELAY);
digitalWrite(RED_LED_PIN, LOW);
delay(DELAY);
i++;
}
else if (i>=5 && i<15) {
digitalWrite(GRN_LED_PIN, HIGH);
delay(DELAY);
digitalWrite(GRN_LED_PIN, LOW);
delay(DELAY);
i++;
}
else if (i>=15 && i<30) {
digitalWrite(BLU_LED_PIN, HIGH);
delay(DELAY);
digitalWrite(BLU_LED_PIN, LOW);
delay(DELAY);
i++;
}
else
i=0;
}