#include <Adafruit_NeoPixel.h>
#define PIN 6 // Data pin for NeoPixels
#define NUMPIXELS 12 // Number of NeoPixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin();
}
void loop() {
flashWhite(1000); // Flash white for 1000 milliseconds (1 second)
delay(2000); // Delay for 2 seconds before flashing again
}
void flashWhite(int duration) {
unsigned long startTime = millis();
while (millis() - startTime < duration) {
pixels.fill(pixels.Color(255, 255, 255)); // White
pixels.show();
delay(1); // Very short delay for a fast flicker
pixels.fill(pixels.Color(0, 0, 0)); // Off
pixels.show();
delay(1); // Very short delay for a fast flicker
}
}