mirror of
https://github.com/wled/WLED.git
synced 2025-07-28 13:16:34 +00:00
Realtime max. brightness now honors brightness factor (fixes #1271)
- Colorful effect now supports palettes - Added C9 2 palette (#1291) - Improved C9 palette brightness by 12% - Disable onboard LED if LEDs are off (PR #1245) - Added optional status LED (PR #1264) - Realtime max. brightness now honors brightness factor (fixes #1271) - Updated ArduinoJSON to 6.17.0
This commit is contained in:
parent
3b7f5a1397
commit
373d12be64
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
### Development versions after the 0.10.2 release
|
### Development versions after the 0.10.2 release
|
||||||
|
|
||||||
|
#### Build 2010290
|
||||||
|
|
||||||
|
- Colorful effect now supports palettes
|
||||||
|
- Added C9 2 palette (#1291)
|
||||||
|
- Improved C9 palette brightness by 12%
|
||||||
|
- Disable onboard LED if LEDs are off (PR #1245)
|
||||||
|
- Added optional status LED (PR #1264)
|
||||||
|
- Realtime max. brightness now honors brightness factor (fixes #1271)
|
||||||
|
- Updated ArduinoJSON to 6.17.0
|
||||||
|
|
||||||
#### Build 2010020
|
#### Build 2010020
|
||||||
|
|
||||||
- Fixed interaction of `T` and `NL` HTTP API commands (#1214)
|
- Fixed interaction of `T` and `NL` HTTP API commands (#1214)
|
||||||
|
@ -802,46 +802,40 @@ uint16_t WS2812FX::mode_chase_rainbow_white(void) {
|
|||||||
* Red - Amber - Green - Blue lights running
|
* Red - Amber - Green - Blue lights running
|
||||||
*/
|
*/
|
||||||
uint16_t WS2812FX::mode_colorful(void) {
|
uint16_t WS2812FX::mode_colorful(void) {
|
||||||
uint32_t cols[]{0x00FF0000,0x00EEBB00,0x0000EE00,0x000077CC,0x00FF0000,0x00EEBB00,0x0000EE00};
|
uint8_t numColors = 4; //3, 4, or 5
|
||||||
if (SEGMENT.intensity < 127) //pastel (easter) colors
|
uint32_t cols[9]{0x00FF0000,0x00EEBB00,0x0000EE00,0x000077CC};
|
||||||
|
if (SEGMENT.intensity > 160 || SEGMENT.palette) { //palette or color
|
||||||
|
if (!SEGMENT.palette) {
|
||||||
|
numColors = 3;
|
||||||
|
for (uint8_t i = 0; i < 3; i++) cols[i] = SEGCOLOR(i);
|
||||||
|
} else {
|
||||||
|
uint16_t fac = 80;
|
||||||
|
if (SEGMENT.palette == 52) {numColors = 5; fac = 61;} //C9 2 has 5 colors
|
||||||
|
for (uint8_t i = 0; i < numColors; i++) {
|
||||||
|
cols[i] = color_from_palette(i*fac, false, true, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (SEGMENT.intensity < 80) //pastel (easter) colors
|
||||||
{
|
{
|
||||||
cols[0] = 0x00FF8040;
|
cols[0] = 0x00FF8040;
|
||||||
cols[1] = 0x00E5D241;
|
cols[1] = 0x00E5D241;
|
||||||
cols[2] = 0x0077FF77;
|
cols[2] = 0x0077FF77;
|
||||||
cols[3] = 0x0077F0F0;
|
cols[3] = 0x0077F0F0;
|
||||||
for (uint8_t i = 4; i < 7; i++) cols[i] = cols[i-4];
|
|
||||||
}
|
}
|
||||||
|
for (uint8_t i = numColors; i < numColors*2 -1; i++) cols[i] = cols[i-numColors];
|
||||||
|
|
||||||
uint32_t cycleTime = 50 + (15 * (uint32_t)(255 - SEGMENT.speed));
|
uint32_t cycleTime = 50 + (8 * (uint32_t)(255 - SEGMENT.speed));
|
||||||
uint32_t it = now / cycleTime;
|
uint32_t it = now / cycleTime;
|
||||||
if (it != SEGENV.step)
|
if (it != SEGENV.step)
|
||||||
{
|
{
|
||||||
if (SEGMENT.speed > 0) SEGENV.aux0++;
|
if (SEGMENT.speed > 0) SEGENV.aux0++;
|
||||||
if (SEGENV.aux0 > 3) SEGENV.aux0 = 0;
|
if (SEGENV.aux0 >= numColors) SEGENV.aux0 = 0;
|
||||||
SEGENV.step = it;
|
SEGENV.step = it;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t i = 0;
|
for (uint16_t i = 0; i < SEGLEN; i+= numColors)
|
||||||
for (i; i < SEGLEN -3; i+=4)
|
|
||||||
{
|
{
|
||||||
setPixelColor(i, cols[SEGENV.aux0]);
|
for (uint16_t j = 0; j < numColors; j++) setPixelColor(i + j, cols[SEGENV.aux0 + j]);
|
||||||
setPixelColor(i+1, cols[SEGENV.aux0+1]);
|
|
||||||
setPixelColor(i+2, cols[SEGENV.aux0+2]);
|
|
||||||
setPixelColor(i+3, cols[SEGENV.aux0+3]);
|
|
||||||
}
|
|
||||||
if(i < SEGLEN)
|
|
||||||
{
|
|
||||||
setPixelColor(i, cols[SEGENV.aux0]);
|
|
||||||
|
|
||||||
if(i+1 < SEGLEN)
|
|
||||||
{
|
|
||||||
setPixelColor(i+1, cols[SEGENV.aux0+1]);
|
|
||||||
|
|
||||||
if(i+2 < SEGLEN)
|
|
||||||
{
|
|
||||||
setPixelColor(i+2, cols[SEGENV.aux0+2]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FRAMETIME;
|
return FRAMETIME;
|
||||||
|
@ -729,7 +729,7 @@ const char JSON_palette_names[] PROGMEM = R"=====([
|
|||||||
"Pastel","Sunset 2","Beech","Vintage","Departure","Landscape","Beach","Sherbet","Hult","Hult 64",
|
"Pastel","Sunset 2","Beech","Vintage","Departure","Landscape","Beach","Sherbet","Hult","Hult 64",
|
||||||
"Drywet","Jul","Grintage","Rewhi","Tertiary","Fire","Icefire","Cyane","Light Pink","Autumn",
|
"Drywet","Jul","Grintage","Rewhi","Tertiary","Fire","Icefire","Cyane","Light Pink","Autumn",
|
||||||
"Magenta","Magred","Yelmag","Yelblu","Orange & Teal","Tiamat","April Night","Orangery","C9","Sakura",
|
"Magenta","Magred","Yelmag","Yelblu","Orange & Teal","Tiamat","April Night","Orangery","C9","Sakura",
|
||||||
"Aurora","Atlantica"
|
"Aurora","Atlantica","C9 2"
|
||||||
])=====";
|
])=====";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -102,6 +102,7 @@ void colorUpdated(int callMode);
|
|||||||
void updateInterfaces(uint8_t callMode);
|
void updateInterfaces(uint8_t callMode);
|
||||||
void handleTransitions();
|
void handleTransitions();
|
||||||
void handleNightlight();
|
void handleNightlight();
|
||||||
|
byte scaledBri(byte in);
|
||||||
|
|
||||||
//lx_parser.cpp
|
//lx_parser.cpp
|
||||||
bool parseLx(int lxValue, byte* rgbw);
|
bool parseLx(int lxValue, byte* rgbw);
|
||||||
|
@ -34,13 +34,20 @@ void toggleOnOff()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//scales the brightness with the briMultiplier factor
|
||||||
|
byte scaledBri(byte in)
|
||||||
|
{
|
||||||
|
uint32_t d = in*briMultiplier;
|
||||||
|
uint32_t val = d/100;
|
||||||
|
if (val > 255) val = 255;
|
||||||
|
return (byte)val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void setAllLeds() {
|
void setAllLeds() {
|
||||||
if (!realtimeMode || !arlsForceMaxBri)
|
if (!realtimeMode || !arlsForceMaxBri)
|
||||||
{
|
{
|
||||||
double d = briT*briMultiplier;
|
strip.setBrightness(scaledBri(briT));
|
||||||
int val = d/100;
|
|
||||||
if (val > 255) val = 255;
|
|
||||||
strip.setBrightness(val);
|
|
||||||
}
|
}
|
||||||
if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY)
|
if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY)
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#ifndef PalettesWLED_h
|
#ifndef PalettesWLED_h
|
||||||
#define PalettesWLED_h
|
#define PalettesWLED_h
|
||||||
|
|
||||||
#define GRADIENT_PALETTE_COUNT 39
|
#define GRADIENT_PALETTE_COUNT 40
|
||||||
|
|
||||||
const byte ib_jul01_gp[] PROGMEM = {
|
const byte ib_jul01_gp[] PROGMEM = {
|
||||||
0, 194, 1, 1,
|
0, 194, 1, 1,
|
||||||
@ -551,14 +551,14 @@ const byte Orangery_gp[] PROGMEM = {
|
|||||||
|
|
||||||
//inspired by Mark Kriegsman https://gist.github.com/kriegsman/756ea6dcae8e30845b5a
|
//inspired by Mark Kriegsman https://gist.github.com/kriegsman/756ea6dcae8e30845b5a
|
||||||
const byte C9_gp[] PROGMEM = {
|
const byte C9_gp[] PROGMEM = {
|
||||||
0, 184, 4, 0, //red
|
0, 255, 5, 0, //red
|
||||||
60, 184, 4, 0,
|
60, 255, 5, 0,
|
||||||
65, 144, 44, 2, //amber
|
60, 196, 57, 2, //amber (start 61?)
|
||||||
125, 144, 44, 2,
|
120, 196, 57, 2,
|
||||||
130, 4, 96, 2, //green
|
120, 6, 126, 2, //green (start 126?)
|
||||||
190, 4, 96, 2,
|
180, 6, 126, 2,
|
||||||
195, 7, 7, 88, //blue
|
180, 4, 30, 114, //blue (start 191?)
|
||||||
255, 7, 7, 88};
|
255, 4, 30, 114};
|
||||||
|
|
||||||
const byte Sakura_gp[] PROGMEM = {
|
const byte Sakura_gp[] PROGMEM = {
|
||||||
0, 196, 19, 10,
|
0, 196, 19, 10,
|
||||||
@ -583,6 +583,18 @@ const byte Atlantica_gp[] PROGMEM = {
|
|||||||
200, 25,190, 95, //#19BE5F
|
200, 25,190, 95, //#19BE5F
|
||||||
255, 40,170, 80};//#28AA50
|
255, 40,170, 80};//#28AA50
|
||||||
|
|
||||||
|
const byte C9_2_gp[] PROGMEM = {
|
||||||
|
0, 6, 126, 2, //green
|
||||||
|
45, 6, 126, 2,
|
||||||
|
45, 4, 30, 114, //blue
|
||||||
|
90, 4, 30, 114,
|
||||||
|
90, 255, 5, 0, //red
|
||||||
|
135, 255, 5, 0,
|
||||||
|
135, 196, 57, 2, //amber
|
||||||
|
180, 196, 57, 2,
|
||||||
|
180, 137, 85, 2, //yellow
|
||||||
|
255, 137, 85, 2};
|
||||||
|
|
||||||
|
|
||||||
// Single array of defined cpt-city color palettes.
|
// Single array of defined cpt-city color palettes.
|
||||||
// This will let us programmatically choose one based on
|
// This will let us programmatically choose one based on
|
||||||
@ -628,6 +640,7 @@ const byte* const gGradientPalettes[] PROGMEM = {
|
|||||||
Sakura_gp, //49-36 Sakura
|
Sakura_gp, //49-36 Sakura
|
||||||
Aurora_gp, //50-37 Aurora
|
Aurora_gp, //50-37 Aurora
|
||||||
Atlantica_gp, //51-38 Atlantica
|
Atlantica_gp, //51-38 Atlantica
|
||||||
|
C9_2_gp //52-39 C9 2
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -85,7 +85,7 @@ void realtimeLock(uint32_t timeoutMs, byte md)
|
|||||||
if (timeoutMs == 255001 || timeoutMs == 65000) realtimeTimeout = UINT32_MAX;
|
if (timeoutMs == 255001 || timeoutMs == 65000) realtimeTimeout = UINT32_MAX;
|
||||||
realtimeMode = md;
|
realtimeMode = md;
|
||||||
|
|
||||||
if (arlsForceMaxBri && !realtimeOverride) strip.setBrightness(255);
|
if (arlsForceMaxBri && !realtimeOverride) strip.setBrightness(scaledBri(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2010020
|
#define VERSION 2010280
|
||||||
|
|
||||||
// ESP8266-01 (blue) got too little storage space to work with all features of WLED. To use it, you must use ESP8266 Arduino Core v2.4.2 and the setting 512K(No SPIFFS).
|
// ESP8266-01 (blue) got too little storage space to work with all features of WLED. To use it, you must use ESP8266 Arduino Core v2.4.2 and the setting 512K(No SPIFFS).
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user