/* BLINKING LEDs w/variables */
// PINs
int redLedPin = 2;
int grnLedPin = 8;
int bluLedPin = 13;
// Delays
int redBlink = 100;
int grnBlink = 500;
int bluBlink = 1000;
// Counter
int i = 0;
void setup() {
pinMode(redLedPin, OUTPUT);
pinMode(grnLedPin, OUTPUT);
pinMode(bluLedPin, OUTPUT);
}
void loop() {
if (i<5) {
digitalWrite(redLedPin, HIGH);
delay(redBlink);
digitalWrite(redLedPin, LOW);
delay(redBlink);
i++;
}
else if (i>=5 && i<15) {
digitalWrite(grnLedPin, HIGH);
delay(grnBlink);
digitalWrite(grnLedPin, LOW);
delay(grnBlink);
i++;
}
else if (i>=15 && i<30) {
digitalWrite(bluLedPin, HIGH);
delay(bluBlink);
digitalWrite(bluLedPin, LOW);
delay(bluBlink);
i++;
}
else
i=0;
}