mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 17:45:49 +00:00
NeoPixelBus_wrapper
NeoPixelBus_wrapper: A minimal wrapper to replace Adafruit_NeoPixel API to use Makuna's NeoPixelBus API.
(c) 2023, Ton Huisman for ESPEasy.
How to use
- Add this library to your
libfolder - Add the NeoPixelBus library to your
libfolder - Replace the
#include <Adafruit_NeoPixel.h>line by#include <NeoPixelBus_wrapper.h> - Replace your type
Adafruit_NeoPixelvariable(s) by typeNeoPixelBus_wrappervariable(s) - When using runtime instantiation of the wrapper object, replace your
pixels = new Adafruit_NeoPixel(...)call bypixels = new NeoPixelBus_wrapper(...) - Compile, and presto!
Limitations
- Currently only supports the most commonly used NeoPixel stripes
NEO_GRBandNEO_GRBW, and the defaultNEO_KHZ800method. (That's all what is used in ESPEasy...) - When using an ESP8266 and the used GPIO pin is not
GPIO2, you can enable# define NEOPIXEL_WRAPPER_USE_ADAFRUITinNeoPixelBus_wrapper.h, but you'll then be using the Adafruit_NeoPixel library again, as that does allow to select the GPIO pin. TheAdafruit_NeoPixellibrary then has to be available for compilation!
Support
For questions and improvement requests, please use the Github Issues system.