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
    }
示例#2
0
文件: Lily.cpp 项目: Valoa/lily
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();
}
示例#3
0
文件: Lily.cpp 项目: Valoa/lily
bool ledsAreOff() {
  return (!strip.getPixelColor(0));
}
示例#4
0
文件: Lily.cpp 项目: Valoa/lily
void initStrip() {
  strip.begin();
}
void setup() {
    strip.begin(); // Initialize pins for output
    strip.show();  // Turn all LEDs off ASAP
}