diff --git a/src/led.cpp b/src/led.cpp index 5d8dc99..d934177 100644 --- a/src/led.cpp +++ b/src/led.cpp @@ -40,14 +40,31 @@ void Led::loop_off(void) { if (wakeupIndex == 0) { fill_solid(leds, NUM_LEDS, CRGB::Black); } else { - fill_solid(leds, NUM_LEDS, CRGB::White); + CRGB color = ColorFromPalette(HeatColors_p, wakeupIndex); + fill_solid(leds, NUM_LEDS, color); +// fadeToBlackBy( leds, NUM_LEDS, 255-wakeupIndex); FastLED.setBrightness(wakeupIndex); + if (wakeupIndex < 100) { + leds[3] = CRGB::Black; + leds[NUM_LEDS-4] = CRGB::Black; + } + if (wakeupIndex < 150) { + leds[2] = CRGB::Black; + leds[NUM_LEDS-3] = CRGB::Black; + } + if (wakeupIndex < 200) { + leds[1] = CRGB::Black; + leds[NUM_LEDS-2] = CRGB::Black; + } + if (wakeupIndex < 250) { + leds[0] = CRGB::Black; + leds[NUM_LEDS-1] = CRGB::Black; + } + } } void Led::wakeUpLight(uint8_t i) { - fill_solid(leds, NUM_LEDS, CRGB::White); - FastLED.setBrightness(i); Serial.printf("wakeuplight(%d)\n", i); wakeupIndex = i; }