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.
pull/365/head
Michael Richters 7 years ago
parent c761bf70a9
commit b908d2ec69

@ -10,7 +10,7 @@ void LEDChaseEffect::update(void) {
::LEDControl.setCrgbAt(pos, {0, 0, 0}); ::LEDControl.setCrgbAt(pos, {0, 0, 0});
pos += chase_sign; pos += chase_sign;
if (pos >= LED_COUNT || pos <= 0) { if (pos >= (LED_COUNT - 1) || pos <= 0) {
chase_sign = -chase_sign; chase_sign = -chase_sign;
} }
::LEDControl.setCrgbAt(pos, {0, 0, 255}); ::LEDControl.setCrgbAt(pos, {0, 0, 255});

Loading…
Cancel
Save