Merge pull request #1 from keyboardio/f/led-api-update
Updated to use the new LEDMode/LEDControl APIpull/365/head
commit
dafb257e42
@ -1,22 +1,21 @@
|
|||||||
#include "Kaleidoscope-LEDEffect-Chase.h"
|
#include "Kaleidoscope-LEDEffect-Chase.h"
|
||||||
|
|
||||||
LEDChaseEffect_::LEDChaseEffect_(void) {
|
namespace kaleidoscope {
|
||||||
}
|
void LEDChaseEffect::update(void) {
|
||||||
|
|
||||||
void LEDChaseEffect_::update(void) {
|
|
||||||
if (current_chase_counter++ < chase_threshold) {
|
if (current_chase_counter++ < chase_threshold) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
current_chase_counter = 0;
|
current_chase_counter = 0;
|
||||||
LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {0, 0, 0});
|
::LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {0, 0, 0});
|
||||||
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 || pos <= 0) {
|
||||||
chase_sign = -chase_sign;
|
chase_sign = -chase_sign;
|
||||||
}
|
}
|
||||||
LEDControl.setCrgbAt(pos, {0, 0, 255});
|
::LEDControl.setCrgbAt(pos, {0, 0, 255});
|
||||||
LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {255, 0, 0});
|
::LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {255, 0, 0});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LEDChaseEffect_ LEDChaseEffect;
|
kaleidoscope::LEDChaseEffect LEDChaseEffect;
|
||||||
|
Loading…
Reference in new issue