r/FastLED • u/nrgnate • Aug 11 '25
Support Lighting two LEDs at a time in a pattern without using delays
I would like to turn on two LEDs at a time, while not using delays. Once the last two LEDs light, the pattern would just stop and lit LEDs stay solid. Kind of like a segmented swipe.
For an example (repeating until desired amount of LEDs are lit):leds[0] = leds[1] = CRGB(255,255,255);FastLED.show();delay(300);leds[2] = leds[3] = CRGB(255,255,255);FastLED.show();delay(300);leds[4] = leds[5] = CRGB(255,255,255);FastLED.show();delay(300); // time delay in milliseconds......
I know this would use EVERY_N_MILLISECONDS, but everything I have tried just doesn't do the desired effect of matching the long/poor way shown above.
Does anyone have a good example of something like this that my help me wrap my head around it?
Thanks!
4
u/Marmilicious [Marc Miller] Aug 11 '25 edited Aug 11 '25
See if this example covers what you're looking to do.
https://github.com/marmilicious/FastLED_examples/blob/master/double_pixel_chase.ino
2
u/4wheeljive Jeff Holman Aug 11 '25
The following doesn't avoid the use of delays, but would it achieve your goal of facilitating a "tandem" swipe on bootup and whenever you press the button? (I know that using delays can often be problematic, but I'm not sure it would be here for a brief "subroutine" that's called only occasionally.)
[Posted @ 15:45PDT on 250811]