const uint8_t ledCount = 8;
const uint8_t ledRed = 13;
uint8_t ledPins[] =
{
0, 1, 2, 3, 4, 5, 6, 7
};
void setup()
{
pinMode(ledRed, OUTPUT);
for (uint8_t thisLed = 0; thisLed < ledCount; thisLed++)
{
pinMode(ledPins[thisLed], OUTPUT);
}
}
void loop()
{
for (uint8_t thisLed = 0; thisLed < ledCount; thisLed++)
{
digitalWrite(ledPins[thisLed], HIGH);
digitalWrite(ledRed, HIGH);
delay(500);
digitalWrite(ledPins[thisLed], LOW);
digitalWrite(ledRed, LOW);
delay(500);
}
}