mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-26 22:21:38 +01:00
fixed non working example (#381)
* fixed non working example small fix to get the color swipe working * Apply suggestions from code review Co-Authored-By: Otto Winter <otto@otto-winter.com> Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
parent
fa81290579
commit
03ca209105
@ -710,10 +710,10 @@ instance (see API reference for more info).
|
||||
// it[num].get();
|
||||
|
||||
// Example: Simple color wipe
|
||||
for (int i = 1; i < it.size(); i++) {
|
||||
for (int i = it.size() - 1; i > 0; i--) {
|
||||
it[i] = it[i - 1].get();
|
||||
}
|
||||
it[0] = ESPColor::random_color();
|
||||
it[0] = ESPColor::random_color();
|
||||
|
||||
// Bonus: use .range() and .all() to set many LEDs without having to write a loop.
|
||||
it.range(0, 50) = ESPColor::BLACK;
|
||||
|
Loading…
Reference in New Issue
Block a user