From ed0b683754226757a3f4c3088f36909509a22e42 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 13 Sep 2024 11:21:41 -0500 Subject: [PATCH] [LED] Add power pin to addressable LED (#2056) Co-authored-by: Florian <1technophile@users.noreply.github.com> --- lib/LEDManager/LEDManager.cpp | 4 ++++ lib/LEDManager/README.md | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/LEDManager/LEDManager.cpp b/lib/LEDManager/LEDManager.cpp index 356ad40..3a1b383 100644 --- a/lib/LEDManager/LEDManager.cpp +++ b/lib/LEDManager/LEDManager.cpp @@ -28,6 +28,10 @@ void LEDManager::addLEDStrip(int pin, int numLeds) { LEDStrip ledStrip; ledStrip.pin = pin; #ifdef LED_ADDRESSABLE + if (LED_ADDRESSABLE_POWER > -1) { + pinMode(LED_ADDRESSABLE_POWER, OUTPUT); + digitalWrite(LED_ADDRESSABLE_POWER, HIGH); + } ledStrip.strip = new Adafruit_NeoPixel(numLeds, pin, NEO_GRB + NEO_KHZ800); ledStrip.strip->begin(); ledStrip.strip->show(); diff --git a/lib/LEDManager/README.md b/lib/LEDManager/README.md index f8e6fd4..b9f0c21 100644 --- a/lib/LEDManager/README.md +++ b/lib/LEDManager/README.md @@ -30,6 +30,9 @@ build_flags = -DLED_ADDRESSABLE=true ; For non-addressable LEDs, comment out the line above + ; If the Addressable LED requires power + -DLED_ADDRESSABLE_POWER=15 + ; Optional timing configurations: -DBLINK_INTERVAL=500 -DPULSE_INTERVAL=30