mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
1.8 KiB
1.8 KiB
NeoPixelBus_wrapper
NeoPixelBus_wrapper: A minimal wrapper to replace Adafruit_NeoPixel API to use Makuna's NeoPixelBus API.
(c) 2023..2024, 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!
Changelog
- 2024-08-04 tonhuisman: Add support for
fill()method. - 2024-01-31 tonhuisman: Add use of Adafruit_NeoPixel library for ESP8266 to restore configurable GPIO pin usage.
- 2023-10-29 tonhuisman: Initial version, wrapper for minimal use. Only what's used from Adafruit_NeoPixel to use NeoPixelBus library
Support
For questions and improvement requests, please use the Github Issues system.