|
|
@ -27,12 +27,33 @@ LEDControl_::LEDControl_(void) {
|
|
|
|
|
|
|
|
|
|
|
|
void LEDControl_::initialize_led_mode(uint8_t mode) {
|
|
|
|
void LEDControl_::initialize_led_mode(uint8_t mode) {
|
|
|
|
set_all_leds_to(led_off);
|
|
|
|
set_all_leds_to(led_off);
|
|
|
|
switch (LED_MODE_OFF) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case LED_MODE_OFF:
|
|
|
|
switch (mode) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case LED_MODE_RED:
|
|
|
|
|
|
|
|
set_all_leds_to(100,0,0) ;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_MODE_ORANGE:
|
|
|
|
|
|
|
|
set_all_leds_to(100,30,0) ;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_MODE_YELLOW:
|
|
|
|
|
|
|
|
set_all_leds_to(90,70,0) ;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case LED_MODE_HEATMAP:
|
|
|
|
case LED_MODE_GREEN:
|
|
|
|
|
|
|
|
set_all_leds_to(0,200,0) ;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case LED_MODE_BLUE:
|
|
|
|
|
|
|
|
set_all_leds_to(0,30,160) ;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_MODE_INDIGO:
|
|
|
|
|
|
|
|
set_all_leds_to(0,0,200) ;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_MODE_VIOLET:
|
|
|
|
|
|
|
|
set_all_leds_to(100,0,120) ;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_MODE_OFF:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case LED_MODE_BREATHE:
|
|
|
|
case LED_MODE_BREATHE:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -43,9 +64,6 @@ void LEDControl_::initialize_led_mode(uint8_t mode) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case LED_MODE_CHASE:
|
|
|
|
case LED_MODE_CHASE:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case LED_MODE_STEADY:
|
|
|
|
|
|
|
|
set_all_leds_to(led_steady);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -99,8 +117,6 @@ void LEDControl_::update(uint8_t current_keymap) {
|
|
|
|
|
|
|
|
|
|
|
|
case LED_MODE_OFF:
|
|
|
|
case LED_MODE_OFF:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case LED_MODE_HEATMAP:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_MODE_BREATHE:
|
|
|
|
case LED_MODE_BREATHE:
|
|
|
|
effect_breathe_update();
|
|
|
|
effect_breathe_update();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -113,9 +129,6 @@ void LEDControl_::update(uint8_t current_keymap) {
|
|
|
|
case LED_MODE_CHASE:
|
|
|
|
case LED_MODE_CHASE:
|
|
|
|
effect_chase_update();
|
|
|
|
effect_chase_update();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case LED_MODE_STEADY:
|
|
|
|
|
|
|
|
effect_steady_update();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_SPECIAL_MODE_NUMLOCK:
|
|
|
|
case LED_SPECIAL_MODE_NUMLOCK:
|
|
|
|
effect_numlock_update();
|
|
|
|
effect_numlock_update();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -140,8 +153,6 @@ void LEDControl_::effect_numlock_update() {
|
|
|
|
led_set_crgb_at(60, led_breathe); // make numlock breathe
|
|
|
|
led_set_crgb_at(60, led_breathe); // make numlock breathe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LEDControl_::effect_steady_update() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LEDControl_::led_compute_breath() {
|
|
|
|
void LEDControl_::led_compute_breath() {
|
|
|
|
// algorithm from http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/
|
|
|
|
// algorithm from http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/
|
|
|
|