Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>pull/365/head
parent
9b46680240
commit
7f705c43b5
@ -1,22 +1,21 @@
|
||||
#include "Kaleidoscope-LEDEffect-Chase.h"
|
||||
|
||||
LEDChaseEffect_::LEDChaseEffect_(void) {
|
||||
}
|
||||
|
||||
void LEDChaseEffect_::update(void) {
|
||||
namespace kaleidoscope {
|
||||
void LEDChaseEffect::update(void) {
|
||||
if (current_chase_counter++ < chase_threshold) {
|
||||
return;
|
||||
}
|
||||
current_chase_counter = 0;
|
||||
LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {0, 0, 0});
|
||||
LEDControl.setCrgbAt(pos, {0, 0, 0});
|
||||
::LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {0, 0, 0});
|
||||
::LEDControl.setCrgbAt(pos, {0, 0, 0});
|
||||
|
||||
pos += chase_sign;
|
||||
if (pos >= LED_COUNT || pos <= 0) {
|
||||
chase_sign = -chase_sign;
|
||||
}
|
||||
LEDControl.setCrgbAt(pos, {0, 0, 255});
|
||||
LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {255, 0, 0});
|
||||
::LEDControl.setCrgbAt(pos, {0, 0, 255});
|
||||
::LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {255, 0, 0});
|
||||
}
|
||||
}
|
||||
|
||||
LEDChaseEffect_ LEDChaseEffect;
|
||||
kaleidoscope::LEDChaseEffect LEDChaseEffect;
|
||||
|
Loading…
Reference in new issue