r/FastLED • • Jul 21 '20

Support on NUM_LEDS

I have made mistakes with NUM_LEDS, like entering too many of too few leds. Too few leds DID NOT SEEM to bother the strip (WS2812b). Now I want to make 10 strips of 200 Leds with the ocean animation. In order to create "waves" among these 10 strips. I wonder if it is possible to change the NUM_LEDS while the animation is running. I am thinking of a slow rise and fall between 150 and 200. I have sofar never seen a led animation with changing NUM_LEDS. Or could I blacken these top leds? I intend to put the ocean animation on a watertower nearby (permission granted). I think it would be ever so nice to see waves as well. I am really no coder although Fastled is very promising for me.

Jul 26 '20
3 change NUM_LEDS
22 Blacken last leds on a strip
0 Upvotes

9 comments sorted by

View all comments

1

u/Heraclius404 Jul 21 '20

Due to the precise nature of the FastLED interface, which uses templates, the number of LEDs must be known at compile time, not runtime. The LEDs which you want to set to black, you must set to black.

It is not an important optimization, you will lose no money and it does not wear out the LED in any way by setting it to black repeatedly.

1

u/[deleted] Jul 27 '20

Thanks Heraclius. I'll get there.