Fixed bug that caused Fade and Breath effects to reset brightness to 0

This commit is contained in:
cschwinne 2017-09-25 19:32:20 +02:00
parent 97065d402d
commit 7f42ed2d32
2 changed files with 3 additions and 3 deletions

View File

@ -365,7 +365,7 @@ void WS2812FX::mode_breath(void) {
setPixelColor(i, _color); // set all LEDs to selected color
}
int b = map(breath_brightness, 0, 255, 0, _brightness); // keep brightness below brightness set by user
setBrightness(b); // set new brightness to leds
NeoPixelBrightnessBus::SetBrightness(b); // set new brightness to leds
show();
_mode_color = breath_brightness; // we use _mode_color to store the brightness
@ -385,7 +385,7 @@ void WS2812FX::mode_fade(void) {
int b = _counter_mode_step - 127;
b = 255 - (abs(b) * 2);
b = map(b, 0, 255, minval(25, _brightness), _brightness);
setBrightness(b);
NeoPixelBrightnessBus::SetBrightness(b);
show();
_counter_mode_step = (_counter_mode_step + 1) % 256;

View File

@ -20,7 +20,7 @@
#include "CallbackFunction.h"
//version in format yymmddb (b = daily build)
#define VERSION 1709183
#define VERSION 1709251
//to toggle usb serial debug (un)comment following line
//#define DEBUG