Skip to content

Commit

Permalink
Update seesaw_neopixel.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
deisterhold authored Apr 22, 2024
1 parent c182cd7 commit b8ccd76
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/seesaw/light/seesaw_neopixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit b8ccd76

Please sign in to comment.