|
|
@ -10,12 +10,10 @@ using namespace std; |
|
|
|
Led::Led(void) { |
|
|
|
index = 0; |
|
|
|
duration = 0; |
|
|
|
change = true; |
|
|
|
color = CRGB::Orange; |
|
|
|
} |
|
|
|
|
|
|
|
void Led::loop_rainbow(void) { |
|
|
|
fill_rainbow(leds, NUM_LEDS, index, 7); |
|
|
|
fill_rainbow(leds, NUM_LEDS, index, 14); |
|
|
|
} |
|
|
|
|
|
|
|
void Led::loop_confetti(void) |
|
|
@ -39,6 +37,10 @@ void Led::loop_dispense(void) { |
|
|
|
fadeToBlackBy( leds, NUM_LEDS, 20); |
|
|
|
int pos = beatsin16( 13, 0, NUM_LEDS-1 ); |
|
|
|
leds[pos] += CHSV( index, 255, 192); |
|
|
|
|
|
|
|
leds[0] = CRGB::White; |
|
|
|
leds[NUM_LEDS-1] = CRGB::White; |
|
|
|
leds[NUM_LEDS-2] = CRGB::White; |
|
|
|
} |
|
|
|
|
|
|
|
void Led::loop_steady(void) { |
|
|
@ -68,17 +70,19 @@ void Led::setup(void) { |
|
|
|
pinMode(LED_PIN, OUTPUT); |
|
|
|
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS); |
|
|
|
FastLED.setBrightness(96); |
|
|
|
FastLED.setCorrection(0xFF6060); |
|
|
|
FastLED.setCorrection(0xFF5050); |
|
|
|
fill_solid(leds, NUM_LEDS, CRGB::White); |
|
|
|
FastLED.show(); |
|
|
|
color = CRGB::Orange; |
|
|
|
change = true; |
|
|
|
|
|
|
|
refresh = &Led::loop_steady; |
|
|
|
delay(100); |
|
|
|
xTaskCreate( |
|
|
|
&cTaskWrapper, /* Task function. */ |
|
|
|
"ledAnimationTask", /* String with name of task. */ |
|
|
|
4096, /* Stack size in words. */ |
|
|
|
2048, /* Stack size in words. */ |
|
|
|
this, /* Parameter passed as input of the task */ |
|
|
|
1, /* Priority of the task. */ |
|
|
|
tskIDLE_PRIORITY+3, /* Priority of the task. */ |
|
|
|
&ledTaskHandle); /* Task handle. */ |
|
|
|
} |
|
|
|
|
|
|
|