#include <Adafruit_NeoPixel.h>
#define PIN 6 // D6 on Arduino Nano
#define NUM_LEDS 16 // Number of LEDs in Neopixel Ring
Adafruit_NeoPixel strip(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to "off"
}
void loop() {
for (int i = 0; i < NUM_LEDS; i++) {
strip.setPixelColor(i, 255, 0, 0); // Set the current pixel to red
strip.show(); // Update the pixel
delay(40); // Delay to create spinning effect
strip.setPixelColor(i, 0, 0, 200); // Turn off the current pixel
strip.show();
delay(100);
}
}