First of all, my English is not that good so sorry if I made any mistake.
I'm using the WS2812FX, an awesome WS2812 effect library base on Adafruit NeoPixel library to make a small controller for the lightning in my bedroom.
The question here is how do I use this library to control multiple WS2812b led strip with different leds count, like one strip with 30 leds the other with 55 leds but the effect will just cycle through each individual led of each strip.IF somehow I can add one more output pin to this.
Example : There is an effect call "Larson Scanner" will light up one led then it run from the first led to the last led and go back, I want it to do the same on both strips, on the 30 leds strip it goes from first led to 30th led then go back & on the 55 leds strips it goes from first led to the 55th led at the same time.
Hope you guys understand what I'm asking :(
Link to the library : https://github.com/kitesurfer1404/WS2812FX
3 Answers 3
The WS2812 chip requires highly timing dependent pulses to work, as I describe on my page about Neopixels. We are talking about pulse widths of 350 ns.
I suggest it would be impossible to add another strip "if I can add one more output pin to this". It's not a question of adding pins, it's being able to output pulses that fast. You can't do it, at least not on the AVR Arduinos, and I doubt that the ones with faster chips would do it either.
What you could do is connect the various strips together so it is really one long strip (assuming they aren't too far away from each other). The different strips could usefully have their own power supplies, but the data and ground would need to go from the Arduino into the first strip, then out to the second one, and so on.
Something like this:
As for synchronizing the strips, well that is just programming. If you want the first LED on the 30-LED strip to light at the same time as the first LED on the 55-LED strips, then you actually would need to light LED #1 and LED #31 at the same time.
Possible alternative
Actually what might work would be to send to strip #1 first, and then strip #2 after changing pins. That means you would have to interleave the sends. For example to make a pixel seem to run backwards and forward on two strips you make it move one pixel on the first strip, then one pixel on the second strip, and so on.
I'm not sure if the library you mentioned supports that, since the LED count is in the constructor. It looks like it might, as you can change the number of LEDs and the pin number.
You might be able to make two instances of the library object (with different names), initialize them both, and then interleave the sends between them.
-
Your alternative approach works, if you don't need the effects too fast and precise. I've done this with 5 strips (each in its own pin) with 240 LED strips. But this also depends on how complex the calculation of your pattern is.chrisl– chrisl2018年04月18日 20:38:51 +00:00Commented Apr 18, 2018 at 20:38
-
i had some animations that were choppy, then i tried on an ESP32 and whooaa nelly, I had to manually delay() it down. best led driver ever...dandavis– dandavis2018年04月19日 00:50:40 +00:00Commented Apr 19, 2018 at 0:50
The library repo itself already describes "segments". So you simply connect the 55-part strip's data-in to the data-out of the 30-part strip. Instantiate as one 85-part strip, and then define the segments and set patterns on each as appropriate.
I had the same question! => Use an arduino per LED strip :) and, if it is necessary to interconnect them to synchronize them In short, work around the problem
translated by Google :(
goes from first led to the 55th led at the same time
... are you saying that both strips have to scan from end to end in the same amount of time?