Add a set of predefined LED color options

pull/21/head
Jesse Vincent 8 years ago
parent 0dc50ff141
commit 0615646c33

@ -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/

@ -4,14 +4,25 @@
#include "KeyboardConfig.h" #include "KeyboardConfig.h"
#define LED_MODES 7 #define LED_MODES 12
#define LED_MODE_OFF 0 #define LED_MODE_OFF 0
#define LED_MODE_STEADY 1
#define LED_MODE_BREATHE 2 #define LED_MODE_RED 1
#define LED_MODE_RAINBOW 3 #define LED_MODE_ORANGE 2
#define LED_MODE_RAINBOW_WAVE 4 #define LED_MODE_YELLOW 3
#define LED_MODE_HEATMAP 5 #define LED_MODE_GREEN 4
#define LED_MODE_CHASE 6 #define LED_MODE_BLUE 5
#define LED_MODE_INDIGO 6
#define LED_MODE_VIOLET 7
#define LED_MODE_BREATHE 8
#define LED_MODE_RAINBOW 9
#define LED_MODE_RAINBOW_WAVE 10
#define LED_MODE_CHASE 11
#define LED_SPECIAL_MODE_NUMLOCK 100 #define LED_SPECIAL_MODE_NUMLOCK 100

Loading…
Cancel
Save