|
@@ -210,6 +210,16 @@ Atm_fade_WS2812& Atm_fade_WS2812::onFinish( atm_cb_push_t callback, int idx /* =
|
|
return *this;
|
|
return *this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+Atm_fade_WS2812& Atm_fade_WS2812::setColor(CHSV hsvColor) {
|
|
|
|
+ this->color = hsvColor ;
|
|
|
|
+ return *this;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Atm_fade_WS2812& Atm_fade_WS2812::setColor(CRGB rgbColor) {
|
|
|
|
+ this->color = rgb2hsv_approximate(rgbColor) ;
|
|
|
|
+ return *this;
|
|
|
|
+}
|
|
|
|
+
|
|
Atm_fade_WS2812& Atm_fade_WS2812::setColor(int hue, int sat, int val) {
|
|
Atm_fade_WS2812& Atm_fade_WS2812::setColor(int hue, int sat, int val) {
|
|
this->color.hue = hue ;
|
|
this->color.hue = hue ;
|
|
this->color.sat = sat ;
|
|
this->color.sat = sat ;
|
|
@@ -279,9 +289,9 @@ void Atm_fade_WS2812::update_leds(float fade_value){
|
|
CRGB temp_led_RGB ;
|
|
CRGB temp_led_RGB ;
|
|
if(this->state() == DOWN || this->state() == ODOWN) {
|
|
if(this->state() == DOWN || this->state() == ODOWN) {
|
|
temp_led_RGB = leds_buffer[led]-CRGB(temp_led[led]);
|
|
temp_led_RGB = leds_buffer[led]-CRGB(temp_led[led]);
|
|
- leds[current_led].r = qsub8 (leds[current_led].r, temp_led_RGB.r);
|
|
|
|
- leds[current_led].g = qsub8 (leds[current_led].g, temp_led_RGB.g);
|
|
|
|
- leds[current_led].b = qsub8 (leds[current_led].b, temp_led_RGB.b);
|
|
|
|
|
|
+ leds[current_led].r = qsub8 (leds[current_led].r, temp_led_RGB.r+1);
|
|
|
|
+ leds[current_led].g = qsub8 (leds[current_led].g, temp_led_RGB.g+1);
|
|
|
|
+ leds[current_led].b = qsub8 (leds[current_led].b, temp_led_RGB.b+1);
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
temp_led_RGB = CRGB(temp_led[led]) - leds_buffer[led];
|
|
temp_led_RGB = CRGB(temp_led[led]) - leds_buffer[led];
|