Browse Source

sunrise

main
Hendrik Langer 7 years ago
parent
commit
c274b2d6ca
  1. 23
      src/led.cpp

23
src/led.cpp

@ -40,14 +40,31 @@ void Led::loop_off(void) {
if (wakeupIndex == 0) { if (wakeupIndex == 0) {
fill_solid(leds, NUM_LEDS, CRGB::Black); fill_solid(leds, NUM_LEDS, CRGB::Black);
} else { } 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); 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) { void Led::wakeUpLight(uint8_t i) {
fill_solid(leds, NUM_LEDS, CRGB::White);
FastLED.setBrightness(i);
Serial.printf("wakeuplight(%d)\n", i); Serial.printf("wakeuplight(%d)\n", i);
wakeupIndex = i; wakeupIndex = i;
} }

Loading…
Cancel
Save