I'm trying to code a Curtain Effect for NeoPixel with the FastLED Library.
This is what I've managed so far:
void loop() {
FastLED.setBrightness(50);
// curtain effect
for(int i=0; i<=75; i++) {
leds[i] = CRGB::Blue;
FastLED.show();
delay(30);
} // the 75th LED will be Blue
for(int i=NUM_LEDS; i>75; i--) {
leds[i] = CRGB::Blue;
FastLED.show();
delay(30); // the 76th LED will be Blue
}
for(int i=75; i<=150; i++) {
leds[i] = CRGB::Red;
FastLED.show();
delay(30); // starting from LED #76, they will turn off oneoyone until the end
}
for(int i=75; i<=75; i--) {
leds[i] = CRGB::Red;
FastLED.show();
delay(30); // starting from LED #75, they will turn off oneoyone until the start
}
}
-
They all move separately. What would I need to do that the leds are filled in from both sides at the same time?
-
The time until the next loop depends on the color. For Example, I count 8 seconds for Black, 5 if I choose Green and choosing Red repeats the loop after less than 1 second?? Does someone have an explanation?