diff --git a/LEDControl.cpp b/LEDControl.cpp index 6e70ee3e..f92284a3 100644 --- a/LEDControl.cpp +++ b/LEDControl.cpp @@ -14,10 +14,13 @@ LEDControl_::LEDControl_(void) { led_blue.b = 255; led_dark_blue.r = 0; led_dark_blue.g = 0; - led_dark_blue .b = 127; - led_bright_red.r = 255; - led_bright_red.g = 0; - led_bright_red.b = 0; + led_dark_blue.b = 127; + led_red.r = 255; + led_red.g = 0; + led_red.b = 0; + led_dark_red.r = 127; + led_dark_red.g = 0; + led_dark_red.b = 0; } @@ -101,7 +104,7 @@ void LEDControl_::effect_numlock_update() { led_set_crgb_at(i, led_off); } for (uint8_t i = 44; i < LED_COUNT; i++) { - led_set_crgb_at(i, led_bright_red); + led_set_crgb_at(i, led_red); } led_compute_breath(); led_set_crgb_at(60, led_breathe); // make numlock breathe @@ -138,15 +141,15 @@ void LEDControl_::effect_chase_update() { return; } current_chase_counter = 0; - led_set_crgb_at(pos - chase_pixels, led_off); - led_set_crgb_at(pos, led_dark_blue); + led_set_crgb_at(pos - (chase_sign* chase_pixels), led_off); + led_set_crgb_at(pos, led_off); - pos += chase_pixels; - if (pos > LED_COUNT || pos < 0) { - chase_pixels = -chase_pixels; - pos += chase_pixels; + pos += chase_sign; + if (pos >= LED_COUNT || pos <= 0) { + chase_sign = -chase_sign; } led_set_crgb_at(pos, led_blue); + led_set_crgb_at(pos - (chase_sign * chase_pixels), led_red); led_sync(); } @@ -210,7 +213,7 @@ void LEDControl_::boot_animation() { } void LEDControl_::type_letter(uint8_t letter) { - led_set_crgb_at(letter,led_bright_red); + led_set_crgb_at(letter,led_red); led_sync(); delay(250); led_set_crgb_at(letter,led_off); diff --git a/LEDControl.h b/LEDControl.h index 3f85c50c..76538c3c 100644 --- a/LEDControl.h +++ b/LEDControl.h @@ -36,7 +36,8 @@ class LEDControl_ { cRGB led_steady; cRGB led_blue; cRGB led_dark_blue; - cRGB led_bright_red; + cRGB led_red; + cRGB led_dark_red; cRGB led_breathe; cRGB rainbow; @@ -54,9 +55,10 @@ class LEDControl_ { uint8_t breathe_brightness = 0; // how bright the LED is int8_t breathe_fadeAmount=1; // how many points to fade the LED by (can be negative) - int8_t chase_pixels =1; //negative values when it's going backwar + int8_t chase_sign =1; //negative values when it's going backwar + uint8_t chase_pixels=5; uint8_t current_chase_counter = 0; - static const uint8_t chase_threshold = 6; + static const uint8_t chase_threshold = 20; // End RGB stuff void led_compute_breath(); void effect_breathe_init();