From b8ccd76a3c906682c7a8d15240f4478fc6611981 Mon Sep 17 00:00:00 2001 From: Daniel Eisterhold Date: Mon, 22 Apr 2024 18:01:51 -0500 Subject: [PATCH] Update seesaw_neopixel.cpp --- components/seesaw/light/seesaw_neopixel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/seesaw/light/seesaw_neopixel.cpp b/components/seesaw/light/seesaw_neopixel.cpp index 10e2690..ec39997 100644 --- a/components/seesaw/light/seesaw_neopixel.cpp +++ b/components/seesaw/light/seesaw_neopixel.cpp @@ -7,7 +7,7 @@ namespace seesaw { static const char *const TAG = "seesaw.neopixel"; void SeesawNeopixel::setup() { - this->parent_->setup_neopixel(this->pin_); + this->parent_->setup_neopixel(this->pin_, this->num_leds_); } void SeesawNeopixel::set_num_leds(uint16_t num_leds) { @@ -33,8 +33,10 @@ light::LightTraits SeesawNeopixel::get_traits() { } void SeesawNeopixel::write_state(light::LightState *state) { - auto view = get_view_internal(0); - this->parent_->color_neopixel(view.get_red(), view.get_green(), view.get_blue()); + for(uint16_t i = 0; i < this->size(); i++) { + auto view = get_view_internal(i); + this->parent_->color_neopixel(i, view.get_red(), view.get_green(), view.get_blue()); + } } } // namespace seesaw