// Piny pre LED diódy (D1 až D9)
const int ledPins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10};
// Index strednej LED
const int centerLED = 4; // D5 je 5. LED v zozname (index 4)
// Poradie pre "otáčanie" (zľava doprava, v smere hodinových ručičiek)
const int rotationSequence[] = {0, 1, 2, 5, 8, 7, 6, 3};
const int rotationCount = sizeof(rotationSequence) / sizeof(rotationSequence[0]);
void setup() {
// Nastavenie LED pinov ako výstupy
for (int i = 0; i < 9; i++) {
pinMode(ledPins[i], OUTPUT);
}
// Stredná LED stále svieti
digitalWrite(ledPins[centerLED], HIGH);
}
void loop() {
// Otáčanie LED diód
for (int i = 0; i < rotationCount; i++) {
int currentLED = rotationSequence[i]; // Aktuálna LED v poradí
digitalWrite(ledPins[currentLED], HIGH); // Zapnúť LED
delay(150); // Počkajte 150 ms
digitalWrite(ledPins[currentLED], LOW); // Vypnúť LED
}
}