Skip to content

Commit

Permalink
Coord3D pos / size in leds and effects code
Browse files Browse the repository at this point in the history
index.js
- add readonly Coord3D

AppEffects:
- use leds.size
- use Coord3D pos and call leds[pos]
- remove rows, cols and use leds.size directly

AppLeds:
- use leds.size/P
- setValue size/P
- fxSize/count and fixSize and count

SysModUI
- add count and valueFun to all inits

SysModWeb: sendDataWs: tweak tweak tweak
  • Loading branch information
ewowi committed Jan 25, 2024
1 parent 2215ac2 commit 81371e4
Show file tree
Hide file tree
Showing 11 changed files with 1,394 additions and 1,403 deletions.
17 changes: 17 additions & 0 deletions data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ function generateHTML(json, parentNode = null, rowNr = -1) {
rangeValueNode = cE("span");
rangeValueNode.id = rvNode; //rangeValue
} else if (variable.type == "coord3D") {
if (variable.ro) { //e.g. for reset/restart reason: do not show a select but only show the selected option
varNode = cE("span");
}
else {
varNode = cE("div");
let xNode = cE("input");
xNode.type = "number";
Expand All @@ -332,6 +336,7 @@ function generateHTML(json, parentNode = null, rowNr = -1) {
zNode.placeholder = "z";
zNode.addEventListener('change', (event) => {console.log(variable.type + " change", event.target.parentNode);sendValue(event.target.parentNode);});
varNode.appendChild(zNode);
}
} else {
//input types: text, search, tel, url, email, and password.

Expand Down Expand Up @@ -763,6 +768,18 @@ function changeHTML(variable, node, commandJson, rowNr = -1) {
} else
node.textContent = commandJson.value;
}
else if (node.className == "coord3D") {
if (commandJson.value && Object.keys(commandJson.value)) { //tbd: support arrays (now only objects)
let sep = "";
node.textContent = "";
for (let key of Object.keys(commandJson.value)) {
node.textContent += sep + commandJson.value[key];
sep = ",";
}
}
else
console.log(" value coord3D value not object[x,y,z]", commandJson.value);
}
else { //text and numbers read only
// console.log("changeHTML value span not select", variable, node, commandJson, rowNr);
node.textContent = commandJson.value;
Expand Down
38 changes: 19 additions & 19 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,24 @@ build_flags =
lib_deps =
https://github.com/netmindz/WLED-sync#v0.14.0.b16

[env:lolin_d32]
board = lolin_d32 ;https://github.com/platformio/platform-espressif32/blob/develop/boards/esp32dev.json
[env:esp32dev]
board = esp32dev ;https://github.com/platformio/platform-espressif32/blob/develop/boards/esp32dev.json
; recommended to pin to a platform version, see https://github.com/platformio/platform-espressif32/releases
platform = [email protected] ;using platformio/framework-arduinoespressif32 @ ~3.20014.0 / framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
framework = arduino
upload_speed = 1500000
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
; board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions)
board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions)
board_build.filesystem = littlefs
; board_build.f_flash = 80000000L ; use full 80MHz speed for flash (default = 40Mhz)
; board_build.flash_mode = dio ; (dio = dual i/o; more compatible than qio = quad i/o)
board_build.f_flash = 80000000L ; use full 80MHz speed for flash (default = 40Mhz)
board_build.flash_mode = dio ; (dio = dual i/o; more compatible than qio = quad i/o)
; build_type = debug ;increases flash size!
build_flags =
; -DCONFIG_IDF_TARGET_ESP32=1
; -DCONFIG_ASYNC_TCP_USE_WDT=0
; -DLFS_THREADSAFE ;; enables use of semaphores in LittleFS driver
; -DARDUINO_USB_CDC_ON_BOOT=0 ;; Make sure that the right HardwareSerial driver is picked in arduino-esp32 (needed on "classic ESP32")
-DCONFIG_IDF_TARGET_ESP32=1
-DCONFIG_ASYNC_TCP_USE_WDT=0
-DLFS_THREADSAFE ;; enables use of semaphores in LittleFS driver
-DARDUINO_USB_CDC_ON_BOOT=0 ;; Make sure that the right HardwareSerial driver is picked in arduino-esp32 (needed on "classic ESP32")
${appmod_leds.build_flags}
${usermod_e131.build_flags}
; ${usermod_ha.build_flags}
Expand All @@ -80,24 +81,23 @@ lib_deps =
; RAM: [== ] 15.6% (used 51124 bytes from 327680 bytes)
; Flash: [======= ] 68.1% (used 892033 bytes from 1310720 bytes)

[env:esp32dev]
board = esp32dev ;https://github.com/platformio/platform-espressif32/blob/develop/boards/esp32dev.json
[env:lolin_d32]
board = lolin_d32 ;https://github.com/platformio/platform-espressif32/blob/develop/boards/esp32dev.json
; recommended to pin to a platform version, see https://github.com/platformio/platform-espressif32/releases
platform = [email protected] ;using platformio/framework-arduinoespressif32 @ ~3.20014.0 / framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
framework = arduino
upload_speed = 1500000
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions)
; board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions)
board_build.filesystem = littlefs
board_build.f_flash = 80000000L ; use full 80MHz speed for flash (default = 40Mhz)
board_build.flash_mode = dio ; (dio = dual i/o; more compatible than qio = quad i/o)
; board_build.f_flash = 80000000L ; use full 80MHz speed for flash (default = 40Mhz)
; board_build.flash_mode = dio ; (dio = dual i/o; more compatible than qio = quad i/o)
; build_type = debug ;increases flash size!
build_flags =
-DCONFIG_IDF_TARGET_ESP32=1
-DCONFIG_ASYNC_TCP_USE_WDT=0
-DLFS_THREADSAFE ;; enables use of semaphores in LittleFS driver
-DARDUINO_USB_CDC_ON_BOOT=0 ;; Make sure that the right HardwareSerial driver is picked in arduino-esp32 (needed on "classic ESP32")
; -DCONFIG_IDF_TARGET_ESP32=1
; -DCONFIG_ASYNC_TCP_USE_WDT=0
; -DLFS_THREADSAFE ;; enables use of semaphores in LittleFS driver
; -DARDUINO_USB_CDC_ON_BOOT=0 ;; Make sure that the right HardwareSerial driver is picked in arduino-esp32 (needed on "classic ESP32")
${appmod_leds.build_flags}
${usermod_e131.build_flags}
; ${usermod_ha.build_flags}
Expand Down
Loading

0 comments on commit 81371e4

Please sign in to comment.