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:
Daniel Bjørnbakk 2020-01-12 16:42:44 +01:00 committed by Otto Winter
parent fa81290579
commit 03ca209105
1 changed files with 2 additions and 2 deletions

View File

@ -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;