From a665607fac4acbf626ad29e966cd872ead82dca9 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sat, 14 Apr 2018 18:56:35 +0200 Subject: [PATCH] Finished Dynamic LED drivers --- wled00/WS2812FX.cpp | 2 +- wled00/data/settings_leds.htm | Bin 8108 -> 8086 bytes wled00/htmls01.h | 13 ++++++------- wled00/wled00.ino | 2 +- wled00/wled02_xml.ino | 7 ++----- wled00/wled03_set.ino | 12 +++--------- wled00/wled05_init.ino | 8 +++++--- 7 files changed, 18 insertions(+), 26 deletions(-) diff --git a/wled00/WS2812FX.cpp b/wled00/WS2812FX.cpp index 21db57a2..0c8388bc 100644 --- a/wled00/WS2812FX.cpp +++ b/wled00/WS2812FX.cpp @@ -38,8 +38,8 @@ #define CALL_MODE(n) (this->*_mode[n])(); void WS2812FX::init(bool supportWhite, uint16_t countPixels, uint8_t pin) { - for (int i=0; i < _led_count; i++) _locked[i] = false; begin(supportWhite,countPixels,pin); + for (int i=0; i < _led_count; i++) _locked[i] = false; WS2812FX::setBrightness(_brightness); show(); } diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index e1a93e7e19487c2cd2b3494086ecebea9d86b8e3..c349832df5139ba711e3d35e30d48189d4aab34c 100644 GIT binary patch delta 167 zcmZ2uKh1sv6R))ogDZmzLotH_Ln1>FLn@FqVbEnrX2<~Y^MEjwAqOZ{!cfUj0G8EY z2x4$&aAF8&(3~tNVbAC~`J#+CqvPcDyt9=R7&I6RfT~M@=B0woOaanqK$A*=rj!6h zG$()LSKOS%w}Nrn{fD2AO2QpvPdtpbs>~4oD|4 z6ix2r<&_25mkQL82Q;SyC7jsJi#Bl E0I^#*{Qv*} diff --git a/wled00/htmls01.h b/wled00/htmls01.h index cae21c54..61765e16 100644 --- a/wled00/htmls01.h +++ b/wled00/htmls01.h @@ -86,18 +86,17 @@ const char PAGE_settings_leds1[] PROGMEM = R"=====(

LED setup

LED count (max. 255):
-The default boot color is always saved in preset slot 0.
-Alternatively, apply preset at boot
+LEDs are 4-channel type (RGBW):
+Apply preset at boot (0 uses defaults)
Default RGB color:
+Default white value (only RGBW):
Default brightness: (0-255)
-Default white value (only RGBW, -1 to disable):
-Default effect ID:
-Default effect speed:
-Default effect intensity:
-Default secondary RGB(W):
+Default effect ID:
+Default effect speed:
+Default effect intensity:
diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 891ce42f..d74ff7b4 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -33,7 +33,7 @@ #include "WS2812FX.h" //version in format yymmddb (b = daily build) -#define VERSION 1804121 +#define VERSION 1804141 const String versionString = "0.6.3"; //AP and OTA default passwords (change them!) diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino index a6cc53c3..310e4a4c 100644 --- a/wled00/wled02_xml.ino +++ b/wled00/wled02_xml.ino @@ -141,11 +141,8 @@ String getSettings(byte subPage) resp += ds + "CG" + v + colS[1] +";"; resp += ds + "CB" + v + colS[2] +";"; resp += ds + "CA" + v + briS +";"; - if (useRGBW) { - resp += ds + "CW" + v + whiteS +";"; - } else { - resp += ds + "CW" + v + "-1;"; - } + resp += ds + "EW" + c + useRGBW +";"; + resp += ds + "CW" + v + whiteS +";"; resp += ds + "SR" + v + colSecS[0] +";"; resp += ds + "SG" + v + colSecS[1] +";"; resp += ds + "SB" + v + colSecS[2] +";"; diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index 36695b5a..3167e025 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -117,6 +117,7 @@ void handleSettingsSet(byte subPage) int i = server.arg("LC").toInt(); if (i >= 0 && i <= 1200) ledCount = i; } + useRGBW = server.hasArg("EW"); if (server.hasArg("IS")) //ignore settings and save current brightness, colors and fx as default { colS[0] = col[0]; @@ -165,14 +166,7 @@ void handleSettingsSet(byte subPage) if (server.hasArg("CW")) { int i = server.arg("CW").toInt(); - if (i >= 0 && i <= 255) - { - useRGBW = true; - whiteS = i; - } else { - useRGBW = false; - whiteS = 0; - } + if (i >= 0 && i <= 255) whiteS = i; } if (server.hasArg("CA")) { @@ -236,6 +230,7 @@ void handleSettingsSet(byte subPage) int i = server.arg("BF").toInt(); if (i > 0) briMultiplier = i; } + strip.init(useRGBW,ledCount,PIN); } //UI @@ -382,7 +377,6 @@ void handleSettingsSet(byte subPage) aOtaEnabled = server.hasArg("AO"); } } - strip.init(useRGBW,ledCount,PIN); saveSettingsToEEPROM(); } diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 9033e582..7e58abee 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -4,12 +4,14 @@ void wledInit() { - EEPROM.begin(EEPSIZE); - if (!EEPROM.read(397)) strip.init(EEPROM.read(372),EEPROM.read(229),PIN); //quick init - Serial.begin(115200); Serial.setTimeout(50); + EEPROM.begin(EEPSIZE); + Serial.println("PreStripInit"); + if (!EEPROM.read(397)) strip.init(EEPROM.read(372),EEPROM.read(229),PIN); //quick init + Serial.println("PostStripInit"); + #ifdef USEFS SPIFFS.begin(); #endif