#include <Adafruit_NeoPixel.h>
#define LED_PIN 5 // Pin where the LED strip is connected
#define LED_COUNT 32 // Number of LEDs in the strip
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
hueCycle(10); // Speed of the hue cycle (lower is faster)
}
void hueCycle(uint8_t wait) {
static uint16_t hue = 0; // Hue value (0-65535)
for (int i = 0; i < LED_COUNT; i++) {
strip.setPixelColor(i, strip.ColorHSV(hue + (i * 65536L / LED_COUNT)));
}
strip.show();
hue += 256; // Adjust speed of hue change
delay(wait);
}