diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..811db619a --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,20 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 120 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - keep + - enhancement + - confirmed +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + Hey! This issue has been open for quite some time without any new comments now. + It will be closed automatically in a week if no further activity occurs. + + Thank you for using WLED! +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 68243a3ba..7d3a466c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,28 +2,43 @@ ### Development versions after 0.9.1 release +#### Build 2003262 + + - Fixed compilation for Analog LEDs + - Fixed sync settings network port fields too small + +#### Build 2003261 + + - Fixed live preview not displaying whole light if over 255 LEDs + +#### Build 2003251 + + - Added Pacifica effect (tentative, doesn't yet support other colors) + - Added Atlantica palette + - Fixed ESP32 build of Espalexa + #### Build 2003222 -- Fixed Alexa Whites on non-RGBW lights (bump Espalexa to 2.4.5) + - Fixed Alexa Whites on non-RGBW lights (bump Espalexa to 2.4.5) #### Build 2003221 -- Moved Cronixie driver from FX library to drawOverlay handler + - Moved Cronixie driver from FX library to drawOverlay handler #### Build 2003211 -- Added custom mapping compile define to FX_fcn.h -- Merged pull request #784 by @TravisDean: Fixed initialization bug when toggling skip first -- Added link to youtube videos by Room31 to readme + - Added custom mapping compile define to FX_fcn.h + - Merged pull request #784 by @TravisDean: Fixed initialization bug when toggling skip first + - Added link to youtube videos by Room31 to readme #### Build 2003141 -- Fixed color of main segment returned in JSON API during transition not being target color (closes #765) -- Fixed arlsLock() being called after pixels set in E1.31 (closes #772) -- Fixed HTTP API calls not having an effect if no segment selected (now applies to main segment) + - Fixed color of main segment returned in JSON API during transition not being target color (closes #765) + - Fixed arlsLock() being called after pixels set in E1.31 (closes #772) + - Fixed HTTP API calls not having an effect if no segment selected (now applies to main segment) #### Build 2003121 -- Created changelog.md - make tracking changes to code easier -- Merged pull request #766 by @pille: Fix E1.31 out-of sequence detection + - Created changelog.md - make tracking changes to code easier + - Merged pull request #766 by @pille: Fix E1.31 out-of sequence detection diff --git a/wled00/FX.cpp b/wled00/FX.cpp index a57e9ddac..e5408a424 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -3094,6 +3094,7 @@ uint16_t WS2812FX::mode_plasma(void) { return FRAMETIME; } + /* * Percentage display * Intesity values from 0-100 turn on the leds. @@ -3167,3 +3168,108 @@ uint16_t WS2812FX::mode_heartbeat(void) { return FRAMETIME; } + + +// "Pacifica" +// Gentle, blue-green ocean waves. +// December 2019, Mark Kriegsman and Mary Corey March. +// For Dan. +// +// +// In this animation, there are four "layers" of waves of light. +// +// Each layer moves independently, and each is scaled separately. +// +// All four wave layers are added together on top of each other, and then +// another filter is applied that adds "whitecaps" of brightness where the +// waves line up with each other more. Finally, another pass is taken +// over the led array to 'deepen' (dim) the blues and greens. +// +// The speed and scale and motion each layer varies slowly within independent +// hand-chosen ranges, which is why the code has a lot of low-speed 'beatsin8' functions +// with a lot of oddly specific numeric ranges. +// +// These three custom blue-green color palettes were inspired by the colors found in +// the waters off the southern coast of California, https://goo.gl/maps/QQgd97jjHesHZVxQ7 +// +// Modified for WLED, based on https://github.com/FastLED/FastLED/blob/master/examples/Pacifica/Pacifica.ino +// +uint16_t WS2812FX::mode_pacifica() +{ + CRGBPalette16 pacifica_palette_1 = + { 0x000507, 0x000409, 0x00030B, 0x00030D, 0x000210, 0x000212, 0x000114, 0x000117, + 0x000019, 0x00001C, 0x000026, 0x000031, 0x00003B, 0x000046, 0x14554B, 0x28AA50 }; + CRGBPalette16 pacifica_palette_2 = + { 0x000507, 0x000409, 0x00030B, 0x00030D, 0x000210, 0x000212, 0x000114, 0x000117, + 0x000019, 0x00001C, 0x000026, 0x000031, 0x00003B, 0x000046, 0x0C5F52, 0x19BE5F }; + CRGBPalette16 pacifica_palette_3 = + { 0x000208, 0x00030E, 0x000514, 0x00061A, 0x000820, 0x000927, 0x000B2D, 0x000C33, + 0x000E39, 0x001040, 0x001450, 0x001860, 0x001C70, 0x002080, 0x1040BF, 0x2060FF }; + // Increment the four "color index start" counters, one for each wave layer. + // Each is incremented at a different speed, and the speeds vary over time. + uint16_t sCIStart1 = SEGENV.aux0, sCIStart2 = SEGENV.aux1, sCIStart3 = SEGENV.step, sCIStart4 = SEGENV.step >> 16; + //static uint16_t sCIStart1, sCIStart2, sCIStart3, sCIStart4; + uint32_t deltams = 26 + (SEGMENT.speed >> 3); + + uint16_t speedfactor1 = beatsin16(3, 179, 269); + uint16_t speedfactor2 = beatsin16(4, 179, 269); + uint32_t deltams1 = (deltams * speedfactor1) / 256; + uint32_t deltams2 = (deltams * speedfactor2) / 256; + uint32_t deltams21 = (deltams1 + deltams2) / 2; + sCIStart1 += (deltams1 * beatsin88(1011,10,13)); + sCIStart2 -= (deltams21 * beatsin88(777,8,11)); + sCIStart3 -= (deltams1 * beatsin88(501,5,7)); + sCIStart4 -= (deltams2 * beatsin88(257,4,6)); + SEGENV.aux0 = sCIStart1; SEGENV.aux1 = sCIStart2; + SEGENV.step = sCIStart4; SEGENV.step = (SEGENV.step << 16) + sCIStart3; + + // Clear out the LED array to a dim background blue-green + //fill(132618); + + uint8_t basethreshold = beatsin8( 9, 55, 65); + uint8_t wave = beat8( 7 ); + + for( uint16_t i = 0; i < SEGLEN; i++) { + CRGB c = CRGB(2, 6, 10); + // Render each of four layers, with different scales and speeds, that vary over time + c += pacifica_one_layer(i, pacifica_palette_1, sCIStart1, beatsin16(3, 11 * 256, 14 * 256), beatsin8(10, 70, 130), 0-beat16(301)); + c += pacifica_one_layer(i, pacifica_palette_2, sCIStart2, beatsin16(4, 6 * 256, 9 * 256), beatsin8(17, 40, 80), beat16(401)); + c += pacifica_one_layer(i, pacifica_palette_3, sCIStart3, 6 * 256 , beatsin8(9, 10,38) , 0-beat16(503)); + c += pacifica_one_layer(i, pacifica_palette_3, sCIStart4, 5 * 256 , beatsin8(8, 10,28) , beat16(601)); + + // Add extra 'white' to areas where the four layers of light have lined up brightly + uint8_t threshold = scale8( sin8( wave), 20) + basethreshold; + wave += 7; + uint8_t l = c.getAverageLight(); + if (l > threshold) { + uint8_t overage = l - threshold; + uint8_t overage2 = qadd8(overage, overage); + c += CRGB(overage, overage2, qadd8(overage2, overage2)); + } + + //deepen the blues and greens + c.blue = scale8(c.blue, 145); + c.green = scale8(c.green, 200); + c |= CRGB( 2, 5, 7); + + setPixelColor(i, c.red, c.green, c.blue); + } + + return FRAMETIME; +} + +// Add one layer of waves into the led array +CRGB WS2812FX::pacifica_one_layer(uint16_t i, CRGBPalette16& p, uint16_t cistart, uint16_t wavescale, uint8_t bri, uint16_t ioff) +{ + uint16_t ci = cistart; + uint16_t waveangle = ioff; + uint16_t wavescale_half = (wavescale >> 1) + 20; + + waveangle += ((120 + SEGMENT.intensity) * i); //original 250 * i + uint16_t s16 = sin16(waveangle) + 32768; + uint16_t cs = scale16(s16, wavescale_half) + wavescale_half; + ci += (cs * i); + uint16_t sindex16 = sin16(ci) + 32768; + uint8_t sindex8 = scale16(sindex16, 240); + return ColorFromPalette(p, sindex8, bri, LINEARBLEND); +} diff --git a/wled00/FX.h b/wled00/FX.h index 210039ef4..a38a1f542 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -95,7 +95,7 @@ #define IS_REVERSE ((SEGMENT.options & REVERSE ) == REVERSE ) #define IS_SELECTED ((SEGMENT.options & SELECTED) == SELECTED ) -#define MODE_COUNT 101 +#define MODE_COUNT 102 #define FX_MODE_STATIC 0 #define FX_MODE_BLINK 1 @@ -198,6 +198,7 @@ #define FX_MODE_PERCENT 98 #define FX_MODE_RIPPLE_RAINBOW 99 #define FX_MODE_HEARTBEAT 100 +#define FX_MODE_PACIFICA 101 class WS2812FX { typedef uint16_t (WS2812FX::*mode_ptr)(void); @@ -387,6 +388,7 @@ class WS2812FX { _mode[FX_MODE_PERCENT] = &WS2812FX::mode_percent; _mode[FX_MODE_RIPPLE_RAINBOW] = &WS2812FX::mode_ripple_rainbow; _mode[FX_MODE_HEARTBEAT] = &WS2812FX::mode_heartbeat; + _mode[FX_MODE_PACIFICA] = &WS2812FX::mode_pacifica; _brightness = DEFAULT_BRIGHTNESS; currentPalette = CRGBPalette16(CRGB::Black); @@ -571,7 +573,8 @@ class WS2812FX { mode_plasma(void), mode_percent(void), mode_ripple_rainbow(void), - mode_heartbeat(void); + mode_heartbeat(void), + mode_pacifica(void); private: @@ -621,13 +624,14 @@ class WS2812FX { spots_base(uint16_t); CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat); + CRGB pacifica_one_layer(uint16_t i, CRGBPalette16& p, uint16_t cistart, uint16_t wavescale, uint8_t bri, uint16_t ioff); uint32_t _lastPaletteChange = 0; uint32_t _lastShow = 0; #ifdef WLED_USE_ANALOG_LEDS uint32_t _analogLastShow = 0; - uint32_t _analogLastColor = 0; + RgbwColor _analogLastColor = 0; uint8_t _analogLastBri = 0; #endif @@ -656,7 +660,7 @@ const char JSON_mode_names[] PROGMEM = R"=====([ "Noise 1","Noise 2","Noise 3","Noise 4","Colortwinkles","Lake","Meteor","Meteor Smooth","Railway","Ripple", "Twinklefox","Twinklecat","Halloween Eyes","Solid Pattern","Solid Pattern Tri","Spots","Spots Fade","Glitter","Candle","Fireworks Starburst", "Fireworks 1D","Bouncing Balls","Sinelon","Sinelon Dual","Sinelon Rainbow","Popcorn","Drip","Plasma","Percent","Ripple Rainbow", -"Heartbeat" +"Heartbeat","Pacifica" ])====="; @@ -666,7 +670,7 @@ const char JSON_palette_names[] PROGMEM = R"=====([ "Pastel","Sunset 2","Beech","Vintage","Departure","Landscape","Beach","Sherbet","Hult","Hult 64", "Drywet","Jul","Grintage","Rewhi","Tertiary","Fire","Icefire","Cyane","Light Pink","Autumn", "Magenta","Magred","Yelmag","Yelblu","Orange & Teal","Tiamat","April Night","Orangery","C9","Sakura", -"Aurora" +"Aurora","Atlantica" ])====="; #endif diff --git a/wled00/NpbWrapper.h b/wled00/NpbWrapper.h index 673d82492..6e58b7197 100644 --- a/wled00/NpbWrapper.h +++ b/wled00/NpbWrapper.h @@ -9,6 +9,7 @@ //#define USE_APA102 // Uncomment for using APA102 LEDs. //#define USE_WS2801 // Uncomment for using WS2801 LEDs (make sure you have NeoPixelBus v2.5.6 or newer) //#define USE_LPD8806 // Uncomment for using LPD8806 +//#define USE_P9813 // Uncomment for using P9813 LEDs (make sure you have NeoPixelBus v2.5.8 or newer) //#define WLED_USE_ANALOG_LEDS //Uncomment for using "dumb" PWM controlled LEDs (see pins below, default R: gpio5, G: 12, B: 15, W: 13) //#define WLED_USE_H801 //H801 controller. Please uncomment #define WLED_USE_ANALOG_LEDS as well //#define WLED_USE_5CH_LEDS //5 Channel H801 for cold and warm white @@ -35,7 +36,7 @@ //END CONFIGURATION -#if defined(USE_APA102) || defined(USE_WS2801) || defined(USE_LPD8806) +#if defined(USE_APA102) || defined(USE_WS2801) || defined(USE_LPD8806) || defined(USE_P9813) #define CLKPIN 0 #define DATAPIN 2 #if BTNPIN == CLKPIN || BTNPIN == DATAPIN @@ -73,6 +74,8 @@ #define PIXELMETHOD NeoWs2801Method #elif defined(USE_LPD8806) #define PIXELMETHOD Lpd8806Method + #elif defined(USE_P9813) + #define PIXELMETHOD P9813Method #else #define PIXELMETHOD NeoEsp32Rmt0Ws2812xMethod #endif @@ -84,6 +87,8 @@ #define PIXELMETHOD NeoWs2801Method #elif defined(USE_LPD8806) #define PIXELMETHOD Lpd8806Method + #elif defined(USE_P9813) + #define PIXELMETHOD P9813Method #elif LEDPIN == 2 #define PIXELMETHOD NeoEsp8266Uart1Ws2813Method //if you get an error here, try to change to NeoEsp8266UartWs2813Method or update Neopixelbus #elif LEDPIN == 3 @@ -101,7 +106,10 @@ #define PIXELFEATURE4 DotStarLbgrFeature #elif defined(USE_LPD8806) #define PIXELFEATURE3 Lpd8806GrbFeature - #define PIXELFEATURE4 Lpd8806GrbFeature + #define PIXELFEATURE4 Lpd8806GrbFeature +#elif defined(USE_P9813) + #define PIXELFEATURE3 P9813BgrFeature + #define PIXELFEATURE4 NeoGrbwFeature #else #define PIXELFEATURE3 NeoGrbFeature #define PIXELFEATURE4 NeoGrbwFeature @@ -143,7 +151,7 @@ public: switch (_type) { case NeoPixelType_Grb: - #if defined(USE_APA102) || defined(USE_WS2801) || defined(USE_LPD8806) + #if defined(USE_APA102) || defined(USE_WS2801) || defined(USE_LPD8806) || defined(USE_P9813) _pGrb = new NeoPixelBrightnessBus(countPixels, CLKPIN, DATAPIN); #else _pGrb = new NeoPixelBrightnessBus(countPixels, LEDPIN); @@ -152,7 +160,7 @@ public: break; case NeoPixelType_Grbw: - #if defined(USE_APA102) || defined(USE_WS2801) || defined(USE_LPD8806) + #if defined(USE_APA102) || defined(USE_WS2801) || defined(USE_LPD8806) || defined(USE_P9813) _pGrbw = new NeoPixelBrightnessBus(countPixels, CLKPIN, DATAPIN); #else _pGrbw = new NeoPixelBrightnessBus(countPixels, LEDPIN); diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 266016959..284d9b30f 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -3,7 +3,7 @@ */ //common CSS of settings pages -const char PAGE_settingsCss[] PROGMEM = R"=====()====="; +const char PAGE_settingsCss[] PROGMEM = R"=====()====="; //settings menu const char PAGE_settings[] PROGMEM = R"=====( @@ -273,7 +273,7 @@ Infrared remote:
IR info

WLED Broadcast

-UDP Port:
+UDP Port:
Receive Brightness, Color, and Effects
Send notifications on direct change:
Send notifications on button press:
@@ -316,7 +316,7 @@ Device Auth token:

MQTT

Enable MQTT:
Broker: -Port:
+Port:
The MQTT credentials are sent over an unsecured connection.
Never use the MQTT password for another service!

Username:
diff --git a/wled00/json.cpp b/wled00/json.cpp index 782dc8f68..e79737c43 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -408,8 +408,8 @@ void serveJson(AsyncWebServerRequest* request) void serveLiveLeds(AsyncWebServerRequest* request) { - byte used = ledCount; - byte n = (used -1) /MAX_LIVE_LEDS +1; //only serve every n'th LED if count over MAX_LIVE_LEDS + uint16_t used = ledCount; + uint16_t n = (used -1) /MAX_LIVE_LEDS +1; //only serve every n'th LED if count over MAX_LIVE_LEDS char buffer[2000] = "{\"leds\":["; olen = 9; obuf = buffer; diff --git a/wled00/palettes.h b/wled00/palettes.h index 293843952..1b95e64b2 100644 --- a/wled00/palettes.h +++ b/wled00/palettes.h @@ -13,7 +13,7 @@ #ifndef PalettesWLED_h #define PalettesWLED_h -#define GRADIENT_PALETTE_COUNT 38 +#define GRADIENT_PALETTE_COUNT 39 const byte ib_jul01_gp[] PROGMEM = { 0, 194, 1, 1, @@ -574,6 +574,14 @@ const byte Aurora_gp[] PROGMEM = { 170, 0,243, 45, 200, 0,135, 7, 255, 1, 5, 45};//deep blue + +const byte Atlantica_gp[] PROGMEM = { + 0, 0, 28,112, //#001C70 + 50, 32, 96,255, //#2060FF + 100, 0,243, 45, + 150, 12, 95, 82, //#0C5F52 + 200, 25,190, 95, //#19BE5F + 255, 40,170, 80};//#28AA50 // Single array of defined cpt-city color palettes. @@ -619,6 +627,7 @@ const byte* const gGradientPalettes[] PROGMEM = { C9_gp, //48-35 C9 Sakura_gp, //49-36 Sakura Aurora_gp, //50-37 Aurora + Atlantica_gp, //51-38 Atlantica }; #endif diff --git a/wled00/src/dependencies/espalexa/EspalexaDevice.h b/wled00/src/dependencies/espalexa/EspalexaDevice.h index b964e0e32..4ebdd2b8c 100644 --- a/wled00/src/dependencies/espalexa/EspalexaDevice.h +++ b/wled00/src/dependencies/espalexa/EspalexaDevice.h @@ -2,6 +2,7 @@ #define EspalexaDevice_h #include #include "Arduino.h" +#include typedef class EspalexaDevice; diff --git a/wled00/wled.h b/wled00/wled.h index 9262c6f17..4eebead2f 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -115,7 +115,7 @@ extern "C" #endif // version code in format yymmddb (b = daily build) -#define VERSION 2003222 +#define VERSION 2003301 // Global external variable declaration. See wled.cpp for definitions and comments. extern char versionString[];