-
-
Notifications
You must be signed in to change notification settings - Fork 257
Library Comparisons
Michael Miller edited this page Feb 3, 2023
·
6 revisions
There are multiple competing libraries, FastLED being the biggest and Adafruit NeoPixel being the most common for beginners.
On ESP8266, your primary choices are:
- NeoPixelBus
- Smaller than FastLED, more features and pixel support than esp8266_ws2812_i2s
- On Esp8266 you can choose i2s DMA or UART, both avoiding interrupts (NMIs). FastLED uses interrupts which can be problematic if you use other code that relies on interrupts, or wifi (although FastLED allows other fast interrupts to fire in between pixel updates)
- Supports RGBW pixels (not supported by the other 2 libraries) https://github.com/JoDaNl/esp8266_ws2812_i2s/
- Uses I2S interface to drive Neopixels via DMA providing an asynchronous update.
- Can use UART both in a synchronous and asynchronous model, but asynchronous limits the use of other UART libraries.
- Low level API with other features exposed by external classes.
- Pins available for use varies by platform due to hardware limitations.
- ESP32 parallel support for using both RMT and I2S.
- FastLED
- Very rich API, although at a cost of large code and memory size
- Interrupt driven on ESP8266, so it's sensitive to timing.
- ESP32 support uses RMT which currently is sensitive to timing.
- Adafruit::NeoPixel
- Basic bit bang and interrupt driven library which does not support any other interrupt driven code to work. Not recommended.
On ESP32, both FastLED and NeoPixelBus can provide more than one channel/bus. FastLED primarily uses RMT to support 8 parallel channels. NeoPixelBus now supports the RMT 8 channels and I2S 8/16 channels in parallel. Parallel channels provide for better refresh rate on longer strings (useful past 256 pixels). But do note that the latest cores have issues with high interrupt frequency when using RMT causing timing issues. So, stick to the 8/16 I2S parallel methods.