nflug:
But how does he do it then?
Well when I said
If you ever have room for the LEDs, you'll always have room.
I should have added
If you ever have time for the LEDs, you'll always have time.
If your animations run slow at 1000 or 2000 LEDs, you are running out of time.
Do you want to run the animations with a dependence on how many LEDs are hooked up?
Then you are back, more or less, to your original question. I think it should be a simple matter to trick the fastLED library calls to output only as many packets as necessary.
But it should not need allocating and freeing of memory.
Allocate for a maximum number of LEDs.
Tell fastLED you have some number (<= maximum obvsly) and pass the address to it, doesn't matter that it's too big or too small.
Then all your code and the fastLED library will only take to that smaller number, your animations run apace and all you have which you don't care about at all is an unused amount of memory at the tail end of your real pixels.
Remember, these are there if needed and were not in your way…
Now with more LEDs, more of that memory is used, and your animations start to look like crap. You are out of time.
It should be possible to change the number of LEDs that fastLED will pimp out data for on the fly, but it would be some kind of trick to just change the object's idea of how many LEDs there are and laving the data pointer where it always is: the maximum big array.
fastLED didn't have a terminating call I could find. I thought you could kill one object and instantiate a new one with a new size (BUT the same actual memory address), but I am sure someone can explain or make a hack that just changes its idea of how many LEDs to talk to.
HTH
edit: and you'll have to explain to people why it goes crappy.
a7