diff --git a/platformio.ini b/platformio.ini index c382f924..84200955 100644 --- a/platformio.ini +++ b/platformio.ini @@ -51,7 +51,7 @@ lib_deps_external = https://github.com/crankyoldgit/IRremoteESP8266.git #Time@1.5 #Timezone@1.2.1 - #For use SSD1306 0.91" OLED display uncomment following + #For use SSD1306 OLED display uncomment following #U8g2@~2.27.2 #For Dallas sensor uncomment following 2 lines #DallasTemperature@~3.8.0 diff --git a/readme.md b/readme.md index 8a9d2ada..044344ea 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,7 @@ ![WLED logo](https://raw.githubusercontent.com/Aircoookie/WLED/master/wled_logo.png) [![](https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square)](https://github.com/Aircoookie/WLED/releases) +[![](https://img.shields.io/discourse/topics?colorB=blue&label=forum&server=https%3A%2F%2Fwled.discourse.group%2F&style=flat-square)](https://wled.discourse.group) [![](https://img.shields.io/discord/473448917040758787.svg?colorB=blue&label=discord&style=flat-square)](https://discord.gg/KuqP7NE) [![](https://img.shields.io/badge/quick_start-wiki-blue.svg?style=flat-square)](https://github.com/Aircoookie/WLED/wiki) [![](https://img.shields.io/badge/app-wled-blue.svg?style=flat-square)](https://github.com/Aircoookie/WLED-App) @@ -57,7 +58,8 @@ Credits [here](https://github.com/Aircoookie/WLED/wiki/Contributors-&-About)! Uses Linearicons by Perxis! Join the Discord [server](https://discord.gg/KuqP7NE) to discuss everything about WLED! -You can also send me mails to [dev.aircoookie@gmail.com](mailto:dev.aircoookie@gmail.com). +Check out the WLED [Discourse forum](https://wled.discourse.group)! +You can also send me mails to [dev.aircoookie@gmail.com](mailto:dev.aircoookie@gmail.com), but please only do so if you want to talk to me privately. If WLED really brightens up your every day, you can [![](https://img.shields.io/badge/send%20me%20a%20small%20gift-paypal-blue.svg?style=flat-square)](https://paypal.me/aircoookie) *Disclaimer:* diff --git a/usermods/Enclosure_with_OLED_temp_ESP07/wled06_usermod.ino b/usermods/Enclosure_with_OLED_temp_ESP07/wled06_usermod.ino index 31bba9e6..2c55a952 100644 --- a/usermods/Enclosure_with_OLED_temp_ESP07/wled06_usermod.ino +++ b/usermods/Enclosure_with_OLED_temp_ESP07/wled06_usermod.ino @@ -5,7 +5,7 @@ #define U8X8_PIN_SCL 5 #define U8X8_PIN_SDA 4 // Dallas sensor -OneWire oneWire(12); +OneWire oneWire(13); DallasTemperature sensor(&oneWire); long temptimer = millis(); long lastMeasure = 0; @@ -16,9 +16,9 @@ long lastMeasure = 0; // https://github.com/olikraus/u8g2/wiki/u8x8setupcpp // or check the gallery: // https://github.com/olikraus/u8g2/wiki/gallery -// --> First choise of cheap I2C OLED 128X32 +// --> First choise of cheap I2C OLED 128X32 0.91" U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA -// --> Second choise of cheap I2C OLED 128X64 +// --> Second choise of cheap I2C OLED 128X64 0.96" or 1.3" //U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA // gets called once at boot. Do all initialization that doesn't depend on // network here diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 96880f4d..12d40278 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -346,7 +346,7 @@ uint16_t WS2812FX::mode_dual_scan(void) { * Cycles all LEDs at once through a rainbow. */ uint16_t WS2812FX::mode_rainbow(void) { - uint16_t counter = (now * ((SEGMENT.speed >> 3) +2)) & 0xFFFF; + uint16_t counter = (now * ((SEGMENT.speed >> 2) +2)) & 0xFFFF; counter = counter >> 8; if (SEGMENT.intensity < 128){ @@ -363,7 +363,7 @@ uint16_t WS2812FX::mode_rainbow(void) { * Cycles a rainbow over the entire string of LEDs. */ uint16_t WS2812FX::mode_rainbow_cycle(void) { - uint16_t counter = (now * ((SEGMENT.speed >> 3) +2)) & 0xFFFF; + uint16_t counter = (now * ((SEGMENT.speed >> 2) +2)) & 0xFFFF; counter = counter >> 8; for(uint16_t i = 0; i < SEGLEN; i++) { @@ -691,18 +691,58 @@ uint16_t WS2812FX::mode_android(void) { * color2 and color3 = colors of two adjacent leds */ uint16_t WS2812FX::chase(uint32_t color1, uint32_t color2, uint32_t color3, bool dopalette) { - uint16_t counter = now * (SEGMENT.speed >> 3) + 1; + uint16_t counter = now * ((SEGMENT.speed >> 2) + 1); uint16_t a = counter * SEGLEN >> 16; + SEGENV.step = a; + uint8_t size = 1 + (SEGMENT.intensity * SEGLEN >> 10); + if (SEGENV.call == 0) {SEGENV.aux0 = 0; SEGENV.aux1 = a;} // Use intensity setting to vary chase up to 1/2 string length - uint16_t b = (a + 1 + (SEGMENT.intensity * SEGLEN >> 10)) % SEGLEN; - uint16_t c = (b + 1 + (SEGMENT.intensity * SEGLEN >> 10)) % SEGLEN; + uint16_t b = (a + size) % SEGLEN; + uint16_t c = (b + size) % SEGLEN; if (dopalette) color1 = color_from_palette(a, true, PALETTE_SOLID_WRAP, 1); setPixelColor(a, color1); + if (SEGENV.aux0 == 0) { // catch the first pixels after color change from "chase random" (because they have the "old" color) + for (uint16_t i = 0; i < a; i++) { + uint32_t color = getPixelColor(0); + setPixelColor(i, color1); + } + SEGENV.aux0 = 1; + } setPixelColor(b, color2); setPixelColor(c, color3); + if (a != SEGENV.aux1) { // when speed is too fast, this catches the gaps + if (a > SEGENV.aux1) { + for (uint16_t i = SEGENV.aux1; i <= a; i++) { // sometimes the step-length varies from one to the next call - therefor "<= a" and not "< a" + setPixelColor(i, color1); + uint16_t b1 = (i + size) % SEGLEN; + uint16_t c1 = (b1 + size) % SEGLEN; + setPixelColor(b1, color2); + setPixelColor(c1, color3); + } + } else { + for (uint16_t i = SEGENV.aux1; i <= SEGLEN; i++) { // from last position to the end + setPixelColor(i, color1); + uint16_t b1 = (i + size) % SEGLEN; + uint16_t c1 = (b1 + size) % SEGLEN; + setPixelColor(b1, color2); + setPixelColor(c1, color3); + } + for (uint16_t i = 0; i < a; i++) { // from 0 to the actual position + setPixelColor(i, color1); + uint16_t b1 = (i + size) % SEGLEN; + uint16_t c1 = (b1 + size) % SEGLEN; + setPixelColor(b1, color2); + setPixelColor(c1, color3); + } + SEGENV.step = 0; + SEGENV.aux0 = 0; + } + } + SEGENV.aux1 = ++a; + return FRAMETIME; } @@ -719,10 +759,12 @@ uint16_t WS2812FX::mode_chase_color(void) { * Primary running followed by random color. */ uint16_t WS2812FX::mode_chase_random(void) { + if (!SEGENV.allocateData(2)) return mode_static(); //allocation failed + if (SEGENV.call == 0) SEGENV.data[0] = 0; if (SEGENV.step == 0) { - SEGENV.aux0 = get_random_wheel_index(SEGENV.aux0); + SEGENV.data[0] = get_random_wheel_index(SEGENV.data[0]); } - return chase(color_wheel(SEGENV.aux0), SEGCOLOR(0), SEGCOLOR(0), false); + return chase(color_wheel(SEGENV.data[0]), SEGCOLOR(0), SEGCOLOR(0), false); } @@ -1039,6 +1081,10 @@ uint16_t WS2812FX::mode_comet(void) { for (uint16_t i = SEGENV.aux0; i < index ; i++) { setPixelColor( i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); } + } else if (index < SEGENV.aux0 && index < 10) { + for (uint16_t i = 0; i < index ; i++) { + setPixelColor( i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); + } } SEGENV.aux0 = index++; @@ -1184,20 +1230,23 @@ uint16_t WS2812FX::police_base(uint32_t color1, uint32_t color2) if (idexR >= SEGLEN) idexR = 0; uint16_t topindex = SEGLEN >> 1; - uint16_t idexB = idexR + topindex; + uint16_t idexB = (idexR > topindex) ? idexR - topindex : idexR + topindex; if (SEGENV.call == 0) SEGENV.aux0 = idexR; - - if (idexR > topindex) idexB -= SEGLEN; if (idexB >= SEGLEN) idexB = 0; //otherwise overflow on odd number of LEDs - uint8_t gap = (SEGENV.aux0 < idexR)? idexR - SEGENV.aux0:SEGLEN - SEGENV.aux0 + idexR; - for (uint8_t i = 0; i < gap ; i++) { - if ((idexR - i) < 0) idexR = SEGLEN-1 + i; - if ((idexB - i) < 0) idexB = SEGLEN-1 + i; - setPixelColor(idexR-i, color1); - setPixelColor(idexB-i, color2); + if (SEGENV.aux0 == idexR) { + setPixelColor(idexR, color1); + setPixelColor(idexB, color2); + } else { + uint8_t gap = (SEGENV.aux0 < idexR)? idexR - SEGENV.aux0:SEGLEN - SEGENV.aux0 + idexR; + for (uint8_t i = 0; i <= gap ; i++) { + if ((idexR - i) < 0) idexR = SEGLEN-1 + i; + if ((idexB - i) < 0) idexB = SEGLEN-1 + i; + setPixelColor(idexR-i, color1); + setPixelColor(idexB-i, color2); + } + SEGENV.aux0 = idexR; } - SEGENV.aux0 = idexR; return FRAMETIME; } @@ -3009,25 +3058,38 @@ uint16_t WS2812FX::mode_plasma(void) { */ uint16_t WS2812FX::mode_percent(void) { - uint8_t percent = max(0, min(100, SEGMENT.intensity)); - uint16_t active_leds = SEGLEN * percent / 100.0; + uint8_t percent = max(0, min(200, SEGMENT.intensity)); + uint16_t active_leds = (percent < 100) ? SEGLEN * percent / 100.0 + : SEGLEN * (200 - percent) / 100.0; if (SEGENV.call == 0) SEGENV.step = 0; uint8_t size = (1 + ((SEGMENT.speed * SEGLEN) >> 11)) & 0xFF ; - for (uint16_t i = 0; i < SEGLEN; i++) { - if (i < SEGENV.step) { - setPixelColor(i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); - } - else { - setPixelColor(i, SEGCOLOR(1)); - } - } - if(active_leds > SEGENV.step) { + if (percent < 100) { + for (uint16_t i = 0; i < SEGLEN; i++) { + if (i < SEGENV.step) { + setPixelColor(i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); + } + else { + setPixelColor(i, SEGCOLOR(1)); + } + } + } else { + for (uint16_t i = 0; i < SEGLEN; i++) { + if (i < (SEGLEN - SEGENV.step)) { + setPixelColor(i, SEGCOLOR(1)); + } + else { + setPixelColor(i, color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); + } + } + } + + if(active_leds > SEGENV.step) { // smooth transition to the target value SEGENV.step += size; if (SEGENV.step > active_leds) SEGENV.step = active_leds; } else if (active_leds < SEGENV.step) { - SEGENV.step -= size; + if (SEGENV.step > size) SEGENV.step -= size; else SEGENV.step = 0; if (SEGENV.step < active_leds) SEGENV.step = active_leds; } diff --git a/wled00/data/index.htm b/wled00/data/index.htm index e7ea5e75..1cc88083 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -46,6 +46,12 @@ p { color: #ddd; } +td { + text-align: center; + text-transform: uppercase; + font-size: 14px; +} + button { outline: none; cursor: pointer; @@ -86,6 +92,15 @@ button { margin: -2px 0 4px 0; } +table { + table-layout: fixed; + width: 76%; +} + +td { + text-align: center; +} + .slider-icon { transform: translateY(2px); @@ -370,7 +385,7 @@ input[type=range]::-ms-thumb { background-color: #333; color: white; border: 0px solid white; - border-radius: 5px; + border-radius: 25px; filter: drop-shadow(0px 0px 2px #000); transition-duration: 0.5s; -webkit-backface-visibility: hidden; @@ -387,13 +402,32 @@ input[type=range]::-ms-thumb { vertical-align: middle; } +.qcs-w { + margin-top: 10px; +} +.qcs { + padding: 14px; + margin: 2px; + border-radius: 14px; + display: inline-block; +} +.qcsb { + padding: 13px; + border: 1px solid white; +} + +.cl { + width: 42px; +} + select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background: url("data:image/svg+xml;utf8,") no-repeat; background-size: 12px; - background-position: 210px 16px; + background-position: 206px 16px; + padding-left: 12px !important; background-repeat: no-repeat; outline: none; } @@ -432,21 +466,21 @@ input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; } -.botpad { - margin-bottom: 16px !important; +.segn { + margin: 3px 0 6px 0 !important; } .ic { padding: 6px 0 0 0; } -.xs { - width: 60px; +.xxs { + width: 40px; + margin: 6px; } -.xxs { - width: 42px; - margin: 8px; +.rect { + border-radius: 5px; } .psts { @@ -470,11 +504,19 @@ input[type=number]::-webkit-outer-spin-button { } .cnf { - position: absolute; - top: 75px; - right: 60px; - color: #fff; - cursor: pointer; + position: absolute; + top: 66px; + right: 28px; + color: #fff; + cursor: pointer; + background: #333; + padding: 43px 6px; + border-radius: 5px; +} + +.half { + padding: 6px 6px; + top: 64px; } .del { @@ -572,8 +614,12 @@ input[type=number]::-webkit-outer-spin-button { .h { font-size: 13px; + text-align: center; color: #bbb; - text-align: left; +} + +.bp { + margin-bottom: 5px; } .seg { @@ -652,6 +698,19 @@ input[type=number]::-webkit-outer-spin-button {
+
+
+
+
+
+
+

+
+
+
+
+
R
+
@@ -734,8 +793,8 @@ input[type=number]::-webkit-outer-spin-button {
First preset:
Last preset:
- Time per preset: s
- Transition: s + Time per preset: s
+ Transition: s
@@ -864,9 +923,27 @@ function populateSegments(s)
- Start LED:
- Stop LED: - (${inst.stop - inst.start} LED${inst.stop - inst.start > 1 ? "s":""})
+ + + + + + + + + +
Start LEDStop LED
+ + + + + + + + + +
GroupingSpacing
+
${inst.stop - inst.start} LED${inst.stop - inst.start > 1 ? "s":""} (${Math.ceil((inst.stop - inst.start)/(inst.grp + inst.spc))} virtual)
- Start LED:
- Stop LED: - (${ledCount - ns} LEDs)
- + + + + + + + + + +
Start LEDStop LED
+
${ledCount - ns} LEDs
+
`; d.getElementById('segutil').innerHTML = cn; } function resetUtil() { - var cn = `
`; + var cn = `
`; d.getElementById('segutil').innerHTML = cn; } @@ -1130,6 +1225,13 @@ function setSeg(s){ var stop = parseInt(d.getElementById(`seg${s}e`).value); if (stop <= start) {delSeg(s); return;}; var obj = {"seg": {"id": s, "start": start, "stop": stop}}; + if (d.getElementById(`seg${s}grp`)) + { + var grp = parseInt(d.getElementById(`seg${s}grp`).value); + var spc = parseInt(d.getElementById(`seg${s}spc`).value); + obj.seg.grp = grp; + obj.seg.spc = spc; + } requestJson(obj); } @@ -1225,9 +1327,9 @@ function selectSlot(b) { cd[i].style.margin="5px"; cd[i].style.width="42px"; } - cd[csel].style.border="6px solid white"; + cd[csel].style.border="5px solid white"; cd[csel].style.margin="2px"; - cd[csel].style.width="54px"; + cd[csel].style.width="50px"; if (cpick.color.rgbString !== cd[csel].style.backgroundColor) { cpick.color.set(cd[csel].style.backgroundColor); } diff --git a/wled00/html_settings.h b/wled00/html_settings.h index ae08802b..86b2cfbf 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -234,13 +234,13 @@ Group Topic:
Reboot required to apply changes. MQTT info

Philips Hue

You can find the bridge IP and the light number in the 'About' section of the hue app.
-Poll Hue light every ms:
+Poll Hue light every ms:
Then, receive On/Off, Brightness, and Color
Hue Bridge IP:
- . - . - . -
+ . + . + . +
Press the pushlink button on the bridge, after that save this page!
(when first connecting)
Hue status: Internal ESP Error!