I have a question regarding the declaration of the led array. So my project includes an option to configure the length of the led strip over an HTTP wifi captive portal on my ESP8266. This pretty much worked fine with other led libraries I used like the one from adafruit which had problems with ESP8266 interrupts but in FastLED I have to declare this CRGB array with an constant int number which has to be constant at compiling time. Is there another way of using the library to avoid this because FastLED is my favorite led library by now. Sorry for this not very detailed question I’m still a newbie to c++ and feel free to ask more if you need more information.
Just declare the biggest array you could possibly need, and use part of it (only outputting the pixels you need right now).
wow I’m stupid that I didn’t think of that
thank you I’ll try and hope that it does not have negative effects for example on memory usage
You either have to allocate all of the memory ahead of time, or risk an allocation failure at runtime when you ask for more memory than you have.
Allocating it all ahead of time gives you more predictable, consistent behaviour.