#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip(8, 6, NEO_GRB + NEO_KHZ800);
int position = 0; // Current LED position
void setup() {
strip.begin();
strip.setBrightness(255);
}
void loop() {
// Clear all LEDs
for (int i = 0; i < 8; i++) {
strip.setPixelColor(i, strip.Color(0, 0, 0)); // Turn off
}
// Light up current position
strip.setPixelColor(position, strip.Color(0, 255, 0)); // Green
strip.show(); // Update the strip
// Move to next position
position = position + 1;
if (position >= 8) {
position = 0; // Loop back to start
}
delay(200); // Animation speed
}