/*
Arduino | project-showcase
First ever project on Arduino Uno
Harumb1 — 10/3/24 at 6:58 AM
This demonstates using an array for the LED pins.
The array allows you to do things on different pins without
writing the same blocks of code over and over.
*/
const int NUM_LEDS = 3;
const int LED_PINS[NUM_LEDS] = {13, 12, 10};
void setup() {
Serial.begin(9600);
for (int index = 0; index < NUM_LEDS; index++) {
pinMode(LED_PINS[index], OUTPUT);
}
}
void loop() {
for (int ledNum = 0; ledNum < NUM_LEDS; ledNum++) {
digitalWrite(LED_PINS[ledNum], HIGH);
delay(1000);
digitalWrite(LED_PINS[ledNum], LOW);
}
}