As someone who is just starting with WS2812Bs, I am a little overwhelmed with all the options (as in libraries, etc) I can choose from. FastLED seems to be an interesting choice, but I can’t put a finger on why because it’s difficult to compare the features… One thing I noticed is that some libraries are starting to use DMA as a method on supported architectures - is that something FastLED is doing too or working on? I am just curious because it seems to be a really effective method to reduce the amount of time the processor is used to show the LEDs.
I am working on a little project that is going to use three 8x8 WS2812B LED matrices to display data it loads from the internet. Perhaps you can give me a few pointers on my thoughts:
FastLED seems to be more of a driver to output data to the LED strips itself and provide some extra functions to handle color values and fast calculations?
Is there a suggested library that’ll make handling my matrices easier? Something like Adafruit’s NeoMatrix, but for FastLED? I’ve found LEDMatrix by Jürgen Skrotzky so far.
I think the (fairly new?) option to parallel output to each matrix might be overkill for each set of 64 LEDs? Is that something you’d do on an ESP8266 or ESP32?
Do you have other pointers that might help a newbie get into all of this without getting a brain buffer overflow?
I will be adding DMA support to FastLED when I get back to working on it. The trick is making it work well across the variety of systems/chipsets that FastLED supports.
@Marc_MERLIN That’s a hen and egg problem for me. I don’t have decided on a cpu yet, since I don’t have a feeling for how capable they are for this task. The only feature I’d like is it being supported by the Arduino environment. I need Wifi support, so the ESP8266 and ESP32 came to mind. I might upgrade to a Teensy + ESP8266 if I need more power. Or go a completely different route and use a PiZero / Pi for the management part and use a smaller cpu just as a controller for the LEDs.
One reason for FastLED seems to be the number of architectures it supports. Another one seems to be this community :).
The reason I asked, is that fastled works on ESP32 adn ESP8266, but the last I checked, it works the same way than it would on an uno: it just does bit banging and tries hard to keep the right sync if you’re using neopixels where timing is crucial.
ESP32 has 8 hardware assist RMT channels that will do a perfect wave every time without tying up the CPU
ESP8266 has an I2S DMA driver that can be abused to also put out a perfect wave, without tying up the CPU and worrying about interrupts.
There is a DMA driver for both, but sadly not in FastLED, so you lose the fancy functions.
However, if you’re just trying to light up LEDs and do simple things, you can do it without the fancy fastLED API.
Look at my code to see what I mean about the different drivers: https://github.com/marcmerlin/Neopixel-IR
Do have a look at https://github.com/JoDaNl/esp8266_ws2812_i2s/ and https://github.com/MartyMacGyver/ESP32-Digital-RGB-LED-Drivers as well as how I made a basic common API in my code so that you can use that and it’ll convert to the underlying driver.
@Marc_MERLIN That’s exactly why I had asked about the state of the DMA method above.
Do I need all the fancy features for this project? I am not sure myself. I am just looking into different options I have for now. Some of the math functions might be nice to get bouncy effects, etc. though
As most I have just started playing with the simple Adafruit libraries so far before looking into other options. FastLED has the bonus of being around for some time, has a nice user base and supports all kinds of platforms. It looks like the other competitors are not that far yet.
FastLED is the best library out there, but on ESP chips, does not have the best driver, in my experience. So, for those you need to choose between better API (FastLED), or better underlying driver
Just use fastled with a cheap arduino. You can program your lights using hsv values, create colour palettes, create colour gradients, good community, then if you need dma magic buy a teensy3.2 and guess what, fastled will support that with a slight change to led setup in your code.
If there is something better than teensy for hardware I haven’t come across it.