From b908d2ec6996c36842e93650cb15d2d2a55e0280 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Mon, 2 Apr 2018 00:34:07 -0500 Subject: [PATCH] Change the upper bound to match the lower bound This causes the red light to stop when in gets to the last key, rather than continuing on past the end of the array before turning around. --- src/Kaleidoscope-LEDEffect-Chase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kaleidoscope-LEDEffect-Chase.cpp b/src/Kaleidoscope-LEDEffect-Chase.cpp index c021b5a8..6bc3d5d0 100644 --- a/src/Kaleidoscope-LEDEffect-Chase.cpp +++ b/src/Kaleidoscope-LEDEffect-Chase.cpp @@ -10,7 +10,7 @@ void LEDChaseEffect::update(void) { ::LEDControl.setCrgbAt(pos, {0, 0, 0}); pos += chase_sign; - if (pos >= LED_COUNT || pos <= 0) { + if (pos >= (LED_COUNT - 1) || pos <= 0) { chase_sign = -chase_sign; } ::LEDControl.setCrgbAt(pos, {0, 0, 255});