Is there a limit to how many different pins I can use on an Arduino Mega 2560 to drive WS2812b LEDS using the current FASTLED library?
I want to re-wire my Xmas tree such that each branch (34 branches total) is wired separately and I do not have to daisy-chain them. Note also that each branch would have any number of LEDs, based on length, ranging from 4 (min) to 12 (max) for a total of around 300 LEDS . Do you see any potential problems with this project ?
The biggest concern is that it will balloon your code size, because right now the templates instantiate on pin, not port, so I’d say try it out first by compiling and uploading and making sure you have the flash.
Alternatively, look into a due - same form factor, more flash/ram (and the possibility of parallel output
Great idea… I just now quickly did it with a modified, working sketch of Fire2012 (it was working on an array of 6X25 array of WS2812b on 6 different pins).
Including the actual ‘fire’ code, I created a 32X12 array on 32 different pins of my MEGA2560 and the thing compiled and loaded ok in just under 49 Kb !!
Hi again @Daniel_Garcia , just now did a very quick test with jumper wires from each of the 32 pins used in my 32X12 array sketch and I can see that each of the 32 pins pump 12 LEDs worth of fire animation data !!
I am only guessing that they are indeed 32 totally distinct, unique animations and that I have a working solution for my tree now !!
Very, very impressed with that FASTLED Library !!!
As mentioned, I was able to verify that I can have a 32X12 array of LEDs (384) driven out of 32 different pins of a MEGA 2560 with the FASTLED library. The code running a FIRE2012 style animation compiled to less than 49Kb so I’m happy with that.
However, I actually only have a total of 304 WS2812b in my Xmas tree such that the largest branch has 12 LEDS, some branches 11, 10, etc… and the smallest branch only has 5 LEDS. I want to minimise the amount of data sent such that I can achieve the best FPS rate with my Arduino MEGA.
If I used the following… #define NUM_STRIPS 32 #define MAX_NUM_LEDS_PER_STRIP 12
CRGB leds[NUM_STRIPS][MAX_NUM_LEDS_PER_STRIP];
Thanks, @Daniel_Garcia I apologise for harassing you on the same subject but I am about to start assembling a power and data distribution scheme for my Xmas tree and want to ensure I select the best design before I start soldering everything.
I would expect that the time required to send data to 304 LEDS via 32 different pins to a number of LEDs ranging from 5 (min) to 12 (max) per pin is similar to the time taken to send that data via a single pin to 304 LEDs that are daisy-chained ?
Can you confirm that ?
Can you quantify the difference if any ?
It will end up taking longer than if they were in one chain because there will be time spent at the beginning/end of each chain for a variety of work that’s outside the raw pushing of LED data. I don’t know offhand how much extra overhead it would be - you’d have to measure that. I’d imagine it wouldn’t be more than a couple microseconds per line.
Daniel ,yes a question.It is possible to drive an endless amount of leds (rgb analog) with shift registers , thus I was curious would one not be able to do the same with digital led strips perhaps? Then not having to worry about running out of pwm pins on arduino.