/* Toggling ALL four LEDs of EduBase V2 sequentially * This program uses an array to index to each LED. */ const int PINS[] = {2, 3, 7, 8}; /* 4 pins of 2,3,7, and 8 are connected to LED0 to LED3 of EduBase V2 */ void setup() { /* configure pins for output */ for (int i = 0; i < 4; i++) { pinMode(PINS[i], OUTPUT); } } void loop() { /* turn PINS on one at a time */ for (int i = 0; i < 4; i++) { digitalWrite(PINS[i], HIGH); /* turn PINS on */ delay(500); /* for 500 ms */ digitalWrite(PINS[i], LOW); /* turn the same PINS off */ } }