Improved colortwinkles on longer strips
Added offMode
This commit is contained in:
parent
d3fc0309c0
commit
bec745d095
@ -2583,6 +2583,8 @@ uint16_t WS2812FX::mode_colortwinkle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (uint16_t j = 0; j <= SEGMENT_LENGTH / 50; j++)
|
||||||
|
{
|
||||||
if ( random8() <= SEGMENT.intensity ) {
|
if ( random8() <= SEGMENT.intensity ) {
|
||||||
for (uint8_t times = 0; times < 5; times++) //attempt to spawn a new pixel 5 times
|
for (uint8_t times = 0; times < 5; times++) //attempt to spawn a new pixel 5 times
|
||||||
{
|
{
|
||||||
@ -2591,7 +2593,8 @@ uint16_t WS2812FX::mode_colortwinkle()
|
|||||||
fastled_col = ColorFromPalette(currentPalette, random8(), 64, NOBLEND);
|
fastled_col = ColorFromPalette(currentPalette, random8(), 64, NOBLEND);
|
||||||
_locked[i] = true;
|
_locked[i] = true;
|
||||||
setPixelColor(i, fastled_col.red, fastled_col.green, fastled_col.blue);
|
setPixelColor(i, fastled_col.red, fastled_col.green, fastled_col.blue);
|
||||||
return 20; //only spawn 1 new pixel per frame
|
break; //only spawn 1 new pixel per frame per 50 LEDs
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
|
|
||||||
//version code in format yymmddb (b = daily build)
|
//version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 1812052
|
#define VERSION 1812141
|
||||||
char versionString[] = "0.8.2";
|
char versionString[] = "0.8.2";
|
||||||
|
|
||||||
|
|
||||||
@ -271,6 +271,8 @@ unsigned long nightlightStartTime;
|
|||||||
byte briNlT = 0; //current nightlight brightness
|
byte briNlT = 0; //current nightlight brightness
|
||||||
|
|
||||||
//brightness
|
//brightness
|
||||||
|
bool offMode = false;
|
||||||
|
unsigned long lastOnTime = 0;
|
||||||
byte bri = briS;
|
byte bri = briS;
|
||||||
byte briOld = 0;
|
byte briOld = 0;
|
||||||
byte briT = 0;
|
byte briT = 0;
|
||||||
@ -528,7 +530,19 @@ void loop() {
|
|||||||
handleHue();
|
handleHue();
|
||||||
handleBlynk();
|
handleBlynk();
|
||||||
}
|
}
|
||||||
if (briT) strip.service(); //do not update strip if off, prevents flicker on ESP32
|
if (briT) lastOnTime = millis();
|
||||||
|
if (millis() - lastOnTime < 600)
|
||||||
|
{
|
||||||
|
offMode = false;
|
||||||
|
strip.service();
|
||||||
|
} else if (!offMode)
|
||||||
|
{
|
||||||
|
/*#if LEDPIN == 2 //turn off onboard LED
|
||||||
|
pinMode(2, OUTPUT);
|
||||||
|
digitalWrite(2, HIGH);
|
||||||
|
#endif*/
|
||||||
|
offMode = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//DEBUG serial logging
|
//DEBUG serial logging
|
||||||
|
Loading…
Reference in New Issue
Block a user