#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define NUM_LEDS 64
Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to off
}
void loop() {
staticRainbowEffect();
// runnerRainbow();
// blinkRainbow();
}
void runnerRainbow() {
int delayTime = 50; // Delay between color transitions
for (int i = 0; i < 10; i++) {
int hue = 65536 / 10 * i;
for (int j = 0; j < NUM_LEDS; j++) {
for (int k = 0; k < NUM_LEDS; k++) {
if(j==k) strip.setPixelColor(k, strip.gamma32(strip.ColorHSV(hue)));
else strip.setPixelColor(k, strip.Color(0, 0, 0));
}
strip.show();
delay(50);
}
}
delay(delayTime);
}
void staticRainbowEffect() {
int delayTime = 50; // Delay between color transitions
for (int i = 0; i < NUM_LEDS; i++) {
int hue = 65536 / NUM_LEDS * i;
strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(hue, 255, 255)));
}
strip.show();
delay(delayTime);
}
void blinkRainbow() {
int delayVal = 100;
for(int i = 0; i < 50; i++) {
int hue = 65535 / 50 * i;
strip.fill(strip.gamma32(strip.ColorHSV(hue, 100, 255)));
strip.show();
delay(delayVal);
// strip.clear();
// strip.show();
// delay(delayVal / 2);
}
}