void loop() { strip.setPixelColor(head, color); // 'On' pixel at head strip.setPixelColor(tail, 0); // 'Off' pixel at tail strip.show(); // Refresh strip delay(20); // Pause 20 milliseconds (~50 FPS) if(++head >= NUMPIXELS) { // Increment head index. Off end of strip? head = 0; // Yes, reset head index to start if((color >>= 8) == 0) // Next color (R->G->B) ... past blue now? color = 0xFF0000; // Yes, reset to red }
void makeColor(byte redSend, byte greenSend, byte blueSend ) { for (int i = 0; i < 3; i++ ) { strip.setPixelColor(i, strip.Color(redSend, greenSend, blueSend)); } strip.show(); }
bool ledsAreOff() { return (!strip.getPixelColor(0)); }
void initStrip() { strip.begin(); }
void setup() { strip.begin(); // Initialize pins for output strip.show(); // Turn all LEDs off ASAP }