[LED] Add LED STRIP macros and a third Addressable pin (#2063)

* [LED] Add LED STRIP macros and a third Addressable pin

---------

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2024-09-19 20:36:46 -05:00
1 parent 0b4c6ef107
commit 0d338cc5c5
4 files changed
+39 -18

No files matched your search

+4
View File
@@ -54,6 +54,10 @@ void LEDManager::setMode(int stripIndex, int ledIndex, Mode mode, uint32_t color
} else if (ledIndex >= 0 && ledIndex < ledStrips[stripIndex].ledStates.size()) {
setModeForSingleLED(stripIndex, ledIndex, mode, color, durationOrBlinkCount);
}
} else if (stripIndex == -1) {
for (int i = 0; i < ledStrips.size(); i++) {
setMode(i, ledIndex, mode, color, durationOrBlinkCount);
}
}
}
+3 -3
View File
@@ -62,10 +62,10 @@ void setup() {
void loop() {
#ifdef LED_ADDRESSABLE
// Set all LEDs on the strip to static green
// Set all LEDs on the first strip to static green
ledManager.setMode(0, -1, LEDManager::STATIC, LED_COLOR_GREEN);
// Blink first 5 LEDs red for 3 times
// Blink first 5 LEDs red for 3 times on the first strip
for (int i = 0; i < 5; i++) {
ledManager.setMode(0, i, LEDManager::BLINK, LED_COLOR_RED, 3);
}
@@ -73,7 +73,7 @@ void loop() {
// Set first LED to static green
ledManager.setMode(0, 0, LEDManager::STATIC, LED_COLOR_GREEN);
// Blink second LED red
// Blink second strip LED red
ledManager.setMode(1, 0, LEDManager::BLINK, LED_COLOR_RED, 3);
#endif