Hi all! Working on a large installation and hit a snag with the FastLED

Hi all!

Working on a large installation and hit a snag with the FastLED library that I need some input on. I need to control 18-20 individual strips with only 10-12 WS2812 LEDs per strip (homemade strips of Adafruit Neopixels).

I need to keep them separate due to the way they’re being physically placed so I can’t chain from one to the next; I have more than enough ports on the Arduino Mega, and power is not a problem.

Anyway, my problem is that I can’t control beyond the first 8 strips I add as controllers. Looking at the source, the constant NUM_CONTROLLERS is set to 8. And that constant is used as the array limit for m_Controllers. :frowning:

My main question is: is this a specific limitation of the way the library is coded, a hardware issue, some combination of the two, or just an arbitrary limit?

I have until Friday(!) to get the coding done as wiring it happening the next few nights, so any ideas soon would be awesome. Thanks so much for the library, the awesome inspiration here, and any help you all can give!

And, I guess another way to ask is: if I change the constant to 20, should the core code still work as expected, or will there be known issues? Thanks! :slight_smile:

While I can’t answer for the code or what might happen, personally I would just try it. If it doesn’t work you can always revert back to the initial ‘8’ and figure out what to do from there.

I do suspect it might have something to do with memory on some of the AVRs. The more controllers and LED strips you have, the more memory you’re using. So ‘8’ might’ve been a “safe” number to use. But again, I can’t speak for how the code’s written, only Daniel or Mark can.

Yeah - I figured I’d just try it when I was back on site, but wanted to have backup plans to my backup plans (one of which which involve switching everything over to the Neopixel library, one of which involved re-wiring the entire installation shudder).

If it was known not to work, I’d start somewhere else. Many options, not much time. :slight_smile:

Switch to the 2.1 branch, it gets rid of the static array of controllers that was eating up memory.

Oooo - thanks! I’ll switch to 2.1 today.

I did update the 8 to 20 and got past that limitation, but wasn’t sure if there was anything else hard-coded to work with 8. Everything seemed fine, but I didn’t push it yet. Looks like now I won’t have to :slight_smile: