micrOSDevToolKit 2.9.1__py3-none-any.whl → 2.26.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- env/driver_cp210x/macOS_VCP_Driver/SiLabsUSBDriverDisk.dmg +0 -0
- env/driver_cp210x/macOS_VCP_Driver/macOS_VCP_Driver_Release_Notes.txt +17 -1
- micrOS/micropython/esp32-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32c3-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32c6-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s2-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/{esp32s3-20241129-v1.24.1.bin → esp32s3-4MBflash-20241129-v1.24.1.bin} +0 -0
- micrOS/micropython/esp32s3-8MBflash-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/rpi-pico-w-20251209-v1.27.0.uf2 +0 -0
- micrOS/micropython/tinypico-20251209-v1.27.0.bin +0 -0
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +167 -163
- micrOS/source/Auth.py +37 -0
- micrOS/source/Common.py +361 -116
- micrOS/source/Config.py +32 -22
- micrOS/source/Debug.py +50 -94
- micrOS/source/Espnow.py +377 -100
- micrOS/source/Files.py +207 -0
- micrOS/source/Hooks.py +48 -20
- micrOS/source/InterConnect.py +126 -42
- micrOS/source/Interrupts.py +6 -6
- micrOS/source/Logger.py +63 -26
- micrOS/source/Network.py +41 -21
- micrOS/source/Notify.py +48 -22
- micrOS/source/Pacman.py +326 -0
- micrOS/source/Scheduler.py +14 -54
- micrOS/source/Server.py +67 -69
- micrOS/source/Shell.py +99 -91
- micrOS/source/Tasks.py +141 -95
- micrOS/source/Time.py +19 -18
- micrOS/source/Types.py +53 -9
- micrOS/source/Web.py +381 -76
- micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Debug.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Files.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Scheduler.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Server.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Shell.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/replhelper.cpython-312.pyc +0 -0
- micrOS/source/config/_git.keep +0 -0
- micrOS/source/helpers.py +132 -0
- micrOS/source/micrOS.py +17 -7
- micrOS/source/micrOSloader.py +5 -12
- micrOS/source/microIO.py +44 -20
- micrOS/source/modules/IO_esp32c6.py +38 -0
- micrOS/source/{IO_esp32s3.py → modules/IO_esp32s3.py} +37 -1
- micrOS/source/{IO_m5stamp.py → modules/IO_m5stamp.py} +35 -1
- micrOS/source/{IO_qtpy.py → modules/IO_qtpy.py} +22 -17
- micrOS/source/{IO_tinypico.py → modules/IO_tinypico.py} +38 -0
- micrOS/source/modules/LM_L298N.py +161 -0
- {toolkit/workspace/precompiled → micrOS/source/modules}/LM_L9110_DCmotor.py +3 -3
- micrOS/source/{LM_OV2640.py → modules/LM_OV2640.py} +45 -27
- micrOS/source/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
- micrOS/source/{LM_aht10.py → modules/LM_aht10.py} +2 -2
- micrOS/source/{LM_bme280.py → modules/LM_bme280.py} +3 -3
- micrOS/source/{LM_buzzer.py → modules/LM_buzzer.py} +18 -25
- micrOS/source/{LM_cct.py → modules/LM_cct.py} +17 -21
- micrOS/source/modules/LM_cluster.py +255 -0
- micrOS/source/{LM_co2.py → modules/LM_co2.py} +3 -3
- micrOS/source/{LM_dht11.py → modules/LM_dht11.py} +2 -2
- micrOS/source/{LM_dht22.py → modules/LM_dht22.py} +2 -2
- micrOS/source/{LM_dimmer.py → modules/LM_dimmer.py} +9 -9
- micrOS/source/{LM_distance.py → modules/LM_distance.py} +4 -6
- micrOS/source/{LM_ds18.py → modules/LM_ds18.py} +2 -2
- micrOS/source/{LM_esp32.py → modules/LM_esp32.py} +5 -0
- micrOS/source/modules/LM_espnow.py +53 -0
- micrOS/source/modules/LM_fileserver.py +265 -0
- micrOS/source/{LM_genIO.py → modules/LM_genIO.py} +52 -37
- micrOS/source/{LM_haptic.py → modules/LM_haptic.py} +2 -2
- {toolkit/workspace/precompiled → micrOS/source/modules}/LM_i2c.py +5 -4
- micrOS/source/{LM_i2s_mic.py → modules/LM_i2s_mic.py} +6 -7
- micrOS/source/{LM_ld2410.py → modules/LM_ld2410.py} +2 -2
- micrOS/source/{LM_light_sensor.py → modules/LM_light_sensor.py} +10 -21
- micrOS/source/modules/LM_mh_z19c.py +198 -0
- micrOS/source/modules/LM_neoeffects.py +284 -0
- micrOS/source/{LM_neopixel.py → modules/LM_neopixel.py} +19 -23
- micrOS/source/{LM_oled.py → modules/LM_oled.py} +2 -2
- micrOS/source/{LM_oled_sh1106.py → modules/LM_oled_sh1106.py} +3 -3
- micrOS/source/{LM_oled_ui.py → modules/LM_oled_ui.py} +72 -64
- micrOS/source/modules/LM_pacman.py +320 -0
- micrOS/source/{LM_presence.py → modules/LM_presence.py} +11 -15
- micrOS/source/modules/LM_qmi8658.py +204 -0
- micrOS/source/{LM_rencoder.py → modules/LM_rencoder.py} +2 -2
- micrOS/source/{LM_rest.py → modules/LM_rest.py} +4 -6
- micrOS/source/{LM_rgb.py → modules/LM_rgb.py} +21 -29
- micrOS/source/{LM_roboarm.py → modules/LM_roboarm.py} +8 -8
- micrOS/source/modules/LM_robustness.py +137 -0
- micrOS/source/{LM_servo.py → modules/LM_servo.py} +3 -3
- micrOS/source/{LM_stepper.py → modules/LM_stepper.py} +5 -5
- micrOS/source/{LM_switch.py → modules/LM_switch.py} +11 -9
- micrOS/source/{LM_system.py → modules/LM_system.py} +38 -32
- micrOS/source/modules/LM_tcs3472.py +187 -0
- micrOS/source/{LM_telegram.py → modules/LM_telegram.py} +164 -116
- micrOS/source/{LM_trackball.py → modules/LM_trackball.py} +3 -3
- micrOS/source/{LM_veml7700.py → modules/LM_veml7700.py} +2 -2
- micrOS/source/modules/LM_web.py +38 -0
- micrOS/source/urequests.py +39 -15
- {toolkit/workspace/precompiled → micrOS/source/web}/dashboard.html +4 -0
- micrOS/source/web/editor.js +440 -0
- micrOS/source/web/filesui.html +178 -0
- micrOS/source/web/filesui.js +338 -0
- {toolkit/workspace/precompiled → micrOS/source/web}/index.html +44 -2
- micrOS/source/{uapi.js → web/uapi.js} +48 -7
- micrOS/source/{ustyle.css → web/ustyle.css} +6 -3
- micrOS/utests/__init__.py +0 -0
- micrOS/utests/test_scheduler.py +435 -0
- {micrOSDevToolKit-2.9.1.data → microsdevtoolkit-2.26.1.data}/scripts/devToolKit.py +33 -3
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/METADATA +327 -268
- microsdevtoolkit-2.26.1.dist-info/RECORD +396 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/WHEEL +1 -1
- toolkit/DevEnvCompile.py +63 -33
- toolkit/DevEnvOTA.py +58 -22
- toolkit/DevEnvUSB.py +110 -55
- toolkit/Gateway.py +6 -6
- toolkit/LM_to_compile.dat +6 -4
- toolkit/MicrOSDevEnv.py +127 -57
- toolkit/WebRepl.py +73 -0
- toolkit/dashboard_apps/BackupRestore.py +20 -35
- toolkit/dashboard_apps/CCTDemo.py +12 -17
- toolkit/dashboard_apps/CCTTest.py +20 -24
- toolkit/dashboard_apps/CamStream.py +2 -6
- toolkit/dashboard_apps/CatGame.py +14 -16
- toolkit/dashboard_apps/Dimmer.py +11 -21
- toolkit/dashboard_apps/GetVersion.py +11 -19
- toolkit/dashboard_apps/MicrophoneTest.py +1 -6
- toolkit/dashboard_apps/NeoEffectsDemo.py +22 -35
- toolkit/dashboard_apps/NeopixelTest.py +20 -25
- toolkit/dashboard_apps/PresenceTest.py +2 -8
- toolkit/dashboard_apps/QMI8685_GYRO.py +68 -0
- toolkit/dashboard_apps/RGBTest.py +20 -24
- toolkit/dashboard_apps/RoboArm.py +24 -32
- toolkit/dashboard_apps/SED_test.py +10 -14
- toolkit/dashboard_apps/SensorsTest.py +61 -0
- toolkit/dashboard_apps/SystemTest.py +202 -105
- toolkit/dashboard_apps/Template_app.py +11 -23
- toolkit/dashboard_apps/_app_base.py +34 -0
- toolkit/dashboard_apps/_gyro_visualizer.py +78 -0
- toolkit/dashboard_apps/uLightDemo.py +15 -24
- toolkit/index.html +4 -4
- toolkit/lib/LocalMachine.py +6 -1
- toolkit/lib/MicrosFiles.py +46 -0
- toolkit/lib/Repository.py +64 -0
- toolkit/lib/TerminalColors.py +4 -0
- toolkit/lib/macroScript.py +6 -0
- toolkit/lib/micrOSClient.py +123 -50
- toolkit/lib/micrOSClientHistory.py +156 -0
- toolkit/lib/pip_package_installer.py +5 -2
- toolkit/micrOSdashboard.py +12 -17
- toolkit/micrOSlint.py +20 -8
- toolkit/simulator_lib/__pycache__/IO_darwin.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/aioespnow.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/framebuf.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/micropython.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/mip.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/neopixel.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/network.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_common.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/simgc.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/simulator.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uasyncio.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uos.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/urandom.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/usocket.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/ussl.cpython-312.pyc +0 -0
- toolkit/simulator_lib/aioespnow.py +28 -0
- toolkit/simulator_lib/dht.py +1 -1
- toolkit/simulator_lib/framebuf.py +49 -1
- toolkit/simulator_lib/machine.py +17 -2
- toolkit/simulator_lib/micropython.py +3 -3
- toolkit/simulator_lib/mip.py +165 -0
- toolkit/simulator_lib/neopixel.py +3 -2
- toolkit/simulator_lib/network.py +2 -1
- toolkit/simulator_lib/node_config.json +2 -3
- toolkit/simulator_lib/ntptime.py +1 -1
- toolkit/simulator_lib/{sim_console.py → sim_common.py} +2 -3
- toolkit/simulator_lib/simgc.py +6 -2
- toolkit/simulator_lib/simulator.py +137 -59
- toolkit/simulator_lib/uasyncio.py +33 -2
- toolkit/simulator_lib/uos.py +147 -0
- toolkit/simulator_lib/urandom.py +4 -0
- toolkit/socketClient.py +43 -23
- toolkit/user_data/webhooks/generic.py +1 -1
- toolkit/user_data/webhooks/macro.py +1 -1
- toolkit/user_data/webhooks/template.py +1 -1
- toolkit/workspace/precompiled/Auth.mpy +0 -0
- toolkit/workspace/precompiled/Common.mpy +0 -0
- toolkit/workspace/precompiled/Config.mpy +0 -0
- toolkit/workspace/precompiled/Debug.mpy +0 -0
- toolkit/workspace/precompiled/Espnow.mpy +0 -0
- toolkit/workspace/precompiled/Files.mpy +0 -0
- toolkit/workspace/precompiled/Hooks.mpy +0 -0
- toolkit/workspace/precompiled/InterConnect.mpy +0 -0
- toolkit/workspace/precompiled/Interrupts.mpy +0 -0
- toolkit/workspace/precompiled/Logger.mpy +0 -0
- toolkit/workspace/precompiled/Network.mpy +0 -0
- toolkit/workspace/precompiled/Notify.mpy +0 -0
- toolkit/workspace/precompiled/Pacman.mpy +0 -0
- toolkit/workspace/precompiled/Scheduler.mpy +0 -0
- toolkit/workspace/precompiled/Server.mpy +0 -0
- toolkit/workspace/precompiled/Shell.mpy +0 -0
- toolkit/workspace/precompiled/Tasks.mpy +0 -0
- toolkit/workspace/precompiled/Time.mpy +0 -0
- toolkit/workspace/precompiled/Types.mpy +0 -0
- toolkit/workspace/precompiled/Web.mpy +0 -0
- toolkit/workspace/precompiled/_mpy.version +1 -1
- toolkit/workspace/precompiled/config/_git.keep +0 -0
- toolkit/workspace/precompiled/helpers.mpy +0 -0
- toolkit/workspace/precompiled/micrOS.mpy +0 -0
- toolkit/workspace/precompiled/micrOSloader.mpy +0 -0
- toolkit/workspace/precompiled/microIO.mpy +0 -0
- toolkit/workspace/precompiled/{IO_esp32.mpy → modules/IO_esp32.mpy} +0 -0
- toolkit/workspace/precompiled/{IO_esp32c3.mpy → modules/IO_esp32c3.mpy} +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32c6.mpy +0 -0
- toolkit/workspace/precompiled/{IO_esp32s2.mpy → modules/IO_esp32s2.mpy} +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32s3.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_m5stamp.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_qtpy.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_rp2.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_tinypico.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_L298N.mpy +0 -0
- {micrOS/source → toolkit/workspace/precompiled/modules}/LM_L9110_DCmotor.py +3 -3
- toolkit/workspace/precompiled/modules/LM_OV2640.mpy +0 -0
- toolkit/workspace/precompiled/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
- toolkit/workspace/precompiled/{LM_aht10.mpy → modules/LM_aht10.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_bme280.mpy → modules/LM_bme280.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_buzzer.mpy → modules/LM_buzzer.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_cluster.mpy +0 -0
- toolkit/workspace/precompiled/{LM_co2.mpy → modules/LM_co2.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_dht11.mpy → modules/LM_dht11.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_dht22.mpy → modules/LM_dht22.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_distance.mpy +0 -0
- toolkit/workspace/precompiled/{LM_ds18.mpy → modules/LM_ds18.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_esp32.py → modules/LM_esp32.py} +5 -0
- toolkit/workspace/precompiled/modules/LM_espnow.py +53 -0
- toolkit/workspace/precompiled/modules/LM_fileserver.mpy +0 -0
- toolkit/workspace/precompiled/{LM_gameOfLife.mpy → modules/LM_gameOfLife.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_genIO.mpy +0 -0
- toolkit/workspace/precompiled/{LM_haptic.mpy → modules/LM_haptic.mpy} +0 -0
- {micrOS/source → toolkit/workspace/precompiled/modules}/LM_i2c.py +5 -4
- toolkit/workspace/precompiled/modules/LM_i2s_mic.mpy +0 -0
- toolkit/workspace/precompiled/{LM_ld2410.mpy → modules/LM_ld2410.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_light_sensor.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_mh_z19c.py +198 -0
- toolkit/workspace/precompiled/modules/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/{LM_oled.mpy → modules/LM_oled.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_oled_sh1106.mpy → modules/LM_oled_sh1106.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_pacman.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_qmi8658.py +204 -0
- toolkit/workspace/precompiled/{LM_rencoder.py → modules/LM_rencoder.py} +2 -2
- toolkit/workspace/precompiled/modules/LM_rest.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_rgb.mpy +0 -0
- toolkit/workspace/precompiled/{LM_rgbcct.mpy → modules/LM_rgbcct.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_roboarm.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_robustness.py +137 -0
- toolkit/workspace/precompiled/{LM_servo.mpy → modules/LM_servo.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_sound_event.mpy → modules/LM_sound_event.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_stepper.mpy → modules/LM_stepper.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_switch.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_tcs3472.py +187 -0
- toolkit/workspace/precompiled/modules/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/{LM_tinyrgb.mpy → modules/LM_tinyrgb.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_trackball.mpy → modules/LM_trackball.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_veml7700.mpy → modules/LM_veml7700.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_web.mpy +0 -0
- toolkit/workspace/precompiled/urequests.mpy +0 -0
- {micrOS/source → toolkit/workspace/precompiled/web}/dashboard.html +4 -0
- toolkit/workspace/precompiled/web/editor.js +440 -0
- toolkit/workspace/precompiled/web/filesui.html +178 -0
- toolkit/workspace/precompiled/web/filesui.js +338 -0
- {micrOS/source → toolkit/workspace/precompiled/web}/index.html +44 -2
- toolkit/workspace/precompiled/{uapi.js → web/uapi.js} +48 -7
- toolkit/workspace/precompiled/{ustyle.css → web/ustyle.css} +6 -3
- micrOS/micropython/esp32-20241129-v1.24.1.bin +0 -0
- micrOS/micropython/esp32c3-20240222-v1.22.2.bin +0 -0
- micrOS/micropython/esp32s2-20240602-v1.23.0.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20220618-v1.19.1.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20240602-v1.23.0.bin +0 -0
- micrOS/micropython/esp32s3-20240105-v1.22.1.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20231005-v1.21.0.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20241129-v1.24.1.bin +0 -0
- micrOS/micropython/rpi-pico-w-20241129-v1.24.1.uf2 +0 -0
- micrOS/micropython/tinypico-20241129-v1.24.1.bin +0 -0
- micrOS/source/LM_L298N_DCmotor.py +0 -86
- micrOS/source/LM_catgame.py +0 -75
- micrOS/source/LM_dashboard_be.py +0 -37
- micrOS/source/LM_demo.py +0 -97
- micrOS/source/LM_espnow.py +0 -23
- micrOS/source/LM_intercon.py +0 -57
- micrOS/source/LM_keychain.py +0 -322
- micrOS/source/LM_lmpacman.py +0 -126
- micrOS/source/LM_neoeffects.py +0 -331
- micrOS/source/LM_oledui.py +0 -972
- micrOS/source/LM_pet_feeder.py +0 -78
- micrOS/source/LM_ph_sensor.py +0 -51
- micrOS/source/LM_robustness.py +0 -74
- micrOS/source/reset.py +0 -11
- micrOSDevToolKit-2.9.1.dist-info/RECORD +0 -365
- toolkit/dashboard_apps/AirQualityBME280.py +0 -36
- toolkit/dashboard_apps/AirQualityDHT22_CO2.py +0 -36
- toolkit/lib/file_extensions.py +0 -16
- toolkit/simulator_lib/__pycache__/sim_console.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_console.cpython-38.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_console.cpython-39.pyc +0 -0
- toolkit/workspace/precompiled/IO_esp32s3.mpy +0 -0
- toolkit/workspace/precompiled/IO_m5stamp.mpy +0 -0
- toolkit/workspace/precompiled/IO_qtpy.mpy +0 -0
- toolkit/workspace/precompiled/IO_rp2.mpy +0 -0
- toolkit/workspace/precompiled/IO_tinypico.mpy +0 -0
- toolkit/workspace/precompiled/LM_L298N_DCmotor.mpy +0 -0
- toolkit/workspace/precompiled/LM_OV2640.mpy +0 -0
- toolkit/workspace/precompiled/LM_catgame.py +0 -75
- toolkit/workspace/precompiled/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/LM_dashboard_be.py +0 -37
- toolkit/workspace/precompiled/LM_demo.py +0 -97
- toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/LM_distance.mpy +0 -0
- toolkit/workspace/precompiled/LM_espnow.py +0 -23
- toolkit/workspace/precompiled/LM_genIO.mpy +0 -0
- toolkit/workspace/precompiled/LM_i2s_mic.mpy +0 -0
- toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
- toolkit/workspace/precompiled/LM_keychain.mpy +0 -0
- toolkit/workspace/precompiled/LM_light_sensor.mpy +0 -0
- toolkit/workspace/precompiled/LM_lmpacman.mpy +0 -0
- toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/LM_oledui.mpy +0 -0
- toolkit/workspace/precompiled/LM_pet_feeder.py +0 -78
- toolkit/workspace/precompiled/LM_ph_sensor.py +0 -51
- toolkit/workspace/precompiled/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/LM_rest.mpy +0 -0
- toolkit/workspace/precompiled/LM_rgb.mpy +0 -0
- toolkit/workspace/precompiled/LM_roboarm.mpy +0 -0
- toolkit/workspace/precompiled/LM_robustness.py +0 -74
- toolkit/workspace/precompiled/LM_switch.mpy +0 -0
- toolkit/workspace/precompiled/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/node_config.json +0 -1
- toolkit/workspace/precompiled/reset.mpy +0 -0
- /micrOS/source/{IO_esp32.py → modules/IO_esp32.py} +0 -0
- /micrOS/source/{IO_esp32c3.py → modules/IO_esp32c3.py} +0 -0
- /micrOS/source/{IO_esp32s2.py → modules/IO_esp32s2.py} +0 -0
- /micrOS/source/{IO_rp2.py → modules/IO_rp2.py} +0 -0
- /micrOS/source/{LM_gameOfLife.py → modules/LM_gameOfLife.py} +0 -0
- /micrOS/source/{LM_rgbcct.py → modules/LM_rgbcct.py} +0 -0
- /micrOS/source/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
- /micrOS/source/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
- /micrOS/source/{LM_sound_event.py → modules/LM_sound_event.py} +0 -0
- /micrOS/source/{LM_tinyrgb.py → modules/LM_tinyrgb.py} +0 -0
- /micrOS/source/{udashboard.js → web/udashboard.js} +0 -0
- /micrOS/source/{uwidgets.js → web/uwidgets.js} +0 -0
- /micrOS/source/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info/licenses}/LICENSE +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/top_level.txt +0 -0
- /toolkit/workspace/precompiled/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
- /toolkit/workspace/precompiled/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
- /toolkit/workspace/precompiled/{udashboard.js → web/udashboard.js} +0 -0
- /toolkit/workspace/precompiled/{uwidgets.js → web/uwidgets.js} +0 -0
- /toolkit/workspace/precompiled/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
from machine import Pin, PWM
|
|
2
|
-
from microIO import resolve_pin, pinmap_search
|
|
3
|
-
|
|
4
|
-
#########################################
|
|
5
|
-
# ANALOG DIMMER CONTROLLER PARAMS #
|
|
6
|
-
#########################################
|
|
7
|
-
__L298N_OBJS = []
|
|
8
|
-
# DATA: SPEED (PWM obj), dir pin1, dir pin2
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
#########################################
|
|
12
|
-
# ANALOG DIMMER WITH PWM #
|
|
13
|
-
#########################################
|
|
14
|
-
|
|
15
|
-
def __l298n_init():
|
|
16
|
-
global __L298N_OBJS
|
|
17
|
-
if len(__L298N_OBJS) == 0:
|
|
18
|
-
__L298N_OBJS.append(PWM(Pin(resolve_pin('l298speed')), freq=50))
|
|
19
|
-
__L298N_OBJS.append(Pin(resolve_pin('l298dir_1'), Pin.OUT))
|
|
20
|
-
__L298N_OBJS.append(Pin(resolve_pin('l298dir_2'), Pin.OUT))
|
|
21
|
-
__L298N_OBJS[0].duty(0) # Set default speed (PWM)
|
|
22
|
-
__L298N_OBJS[1].value(0) # Set default direction for dc motor1
|
|
23
|
-
__L298N_OBJS[2].value(1) # Set default direction for dc motor1
|
|
24
|
-
return __L298N_OBJS
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def m1_control(direc=None, speed=None):
|
|
28
|
-
out = {}
|
|
29
|
-
if direc is not None:
|
|
30
|
-
out = set_direction(direc)
|
|
31
|
-
if speed is not None:
|
|
32
|
-
out.update(set_speed(speed))
|
|
33
|
-
return out
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def set_speed(speed=100):
|
|
37
|
-
if 0 <= speed <= 1000:
|
|
38
|
-
print(__l298n_init())
|
|
39
|
-
__l298n_init()[0].duty(speed)
|
|
40
|
-
return {'speed': speed}
|
|
41
|
-
return {'speed': 'value range error'}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def stop():
|
|
45
|
-
return set_speed(0)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def set_direction(direc=0):
|
|
49
|
-
"""
|
|
50
|
-
direc (direction) values:
|
|
51
|
-
0: forward
|
|
52
|
-
1: backward
|
|
53
|
-
"""
|
|
54
|
-
objlist = __l298n_init()
|
|
55
|
-
if direc == 0:
|
|
56
|
-
objlist[1].value(1)
|
|
57
|
-
objlist[2].value(0)
|
|
58
|
-
return {'direction': 'forward'}
|
|
59
|
-
objlist[1].value(0)
|
|
60
|
-
objlist[2].value(1)
|
|
61
|
-
return {'direction': 'backward'}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
#######################
|
|
65
|
-
# LM helper functions #
|
|
66
|
-
#######################
|
|
67
|
-
|
|
68
|
-
def pinmap():
|
|
69
|
-
"""
|
|
70
|
-
[i] micrOS LM naming convention
|
|
71
|
-
Shows logical pins - pin number(s) used by this Load module
|
|
72
|
-
- info which pins to use for this application
|
|
73
|
-
:return dict: pin name (str) - pin value (int) pairs
|
|
74
|
-
"""
|
|
75
|
-
return pinmap_search(['l298speed', 'l298dir_1', 'l298dir_2'])
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def help(widgets=False):
|
|
79
|
-
"""
|
|
80
|
-
[i] micrOS LM naming convention - built-in help message
|
|
81
|
-
:return tuple:
|
|
82
|
-
(widgets=False) list of functions implemented by this application
|
|
83
|
-
(widgets=True) list of widget json for UI generation
|
|
84
|
-
"""
|
|
85
|
-
return 'm1_control direc=<0/1> speed=<0-1023>', 'set_speed <0-1023>',\
|
|
86
|
-
'set_direction <0-1>', 'stop', 'pinmap'
|
micrOS/source/LM_catgame.py
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
from random import randint
|
|
2
|
-
from LM_servo import sduty, deinit, pinmap as pm
|
|
3
|
-
from utime import sleep_ms
|
|
4
|
-
from Types import resolve
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def load():
|
|
8
|
-
"""
|
|
9
|
-
Initialize catgame-servo module
|
|
10
|
-
"""
|
|
11
|
-
return "catgame-servo module - loaded"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def game(repeat=10, delta=20):
|
|
15
|
-
"""
|
|
16
|
-
Servo cat toy "mover" - left-right
|
|
17
|
-
:param repeat int: repeat servo pos change
|
|
18
|
-
:param delta int: center(75) +/-delta(35)
|
|
19
|
-
:return str: verdict
|
|
20
|
-
"""
|
|
21
|
-
sduty(75)
|
|
22
|
-
for _ in range(0, repeat):
|
|
23
|
-
sduty(randint(75-delta, 75+delta))
|
|
24
|
-
sleep_ms(randint(20, 1500))
|
|
25
|
-
sduty(75)
|
|
26
|
-
return 'Game action'
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def live_game(chance=10):
|
|
30
|
-
"""
|
|
31
|
-
Generate game
|
|
32
|
-
:param chance int: percent value 0-100
|
|
33
|
-
:return str: verdict (action / no action)
|
|
34
|
-
"""
|
|
35
|
-
action = randint(1, 10)
|
|
36
|
-
if action <= int(chance/10):
|
|
37
|
-
return game(repeat=5)
|
|
38
|
-
return 'No action'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def stop():
|
|
42
|
-
"""
|
|
43
|
-
Stop game - home position (75) + deinit
|
|
44
|
-
:return str: servo verdict
|
|
45
|
-
"""
|
|
46
|
-
out = sduty(75)
|
|
47
|
-
deinit()
|
|
48
|
-
return out
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
#######################
|
|
52
|
-
# LM helper functions #
|
|
53
|
-
#######################
|
|
54
|
-
|
|
55
|
-
def pinmap():
|
|
56
|
-
"""
|
|
57
|
-
[i] micrOS LM naming convention
|
|
58
|
-
Shows logical pins - pin number(s) used by this Load module
|
|
59
|
-
- info which pins to use for this application
|
|
60
|
-
:return dict: pin name (str) - pin value (int) pairs
|
|
61
|
-
"""
|
|
62
|
-
return pm()
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def help(widgets=False):
|
|
66
|
-
"""
|
|
67
|
-
[i] micrOS LM naming convention - built-in help message
|
|
68
|
-
:return tuple:
|
|
69
|
-
(widgets=False) list of functions implemented by this application
|
|
70
|
-
(widgets=True) list of widget json for UI generation
|
|
71
|
-
"""
|
|
72
|
-
return resolve(('BUTTON game repeat=10',
|
|
73
|
-
'SLIDER live_game chance=<10-90>',
|
|
74
|
-
'BUTTON stop', 'pinmap',
|
|
75
|
-
'load'), widgets=widgets)
|
micrOS/source/LM_dashboard_be.py
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from Common import web_endpoint, syslog
|
|
2
|
-
|
|
3
|
-
ENDPOINT_INITED = False
|
|
4
|
-
|
|
5
|
-
def load():
|
|
6
|
-
return create_dashboard()
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def _dashboard_clb():
|
|
10
|
-
try:
|
|
11
|
-
with open('dashboard.html', 'r') as html:
|
|
12
|
-
html_content = html.read()
|
|
13
|
-
return 'text/html', html_content
|
|
14
|
-
except Exception as e:
|
|
15
|
-
syslog(f"[ERR] dashboard_be: {e}")
|
|
16
|
-
html_content = None
|
|
17
|
-
return 'text/plain', f'html_content error: {html_content}'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def create_dashboard():
|
|
21
|
-
"""
|
|
22
|
-
Create dashboard endpoint
|
|
23
|
-
"""
|
|
24
|
-
global ENDPOINT_INITED
|
|
25
|
-
ENDPOINT_INITED = True
|
|
26
|
-
web_endpoint('dashboard', _dashboard_clb)
|
|
27
|
-
return 'Endpoint created: /dashboard'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def help(widgets=False):
|
|
31
|
-
"""
|
|
32
|
-
[i] micrOS LM naming convention - built-in help message
|
|
33
|
-
:return tuple:
|
|
34
|
-
(widgets=False) list of functions implemented by this application
|
|
35
|
-
(widgets=True) list of widget json for UI generation
|
|
36
|
-
"""
|
|
37
|
-
return 'load', 'create_dashboard', 'help'
|
micrOS/source/LM_demo.py
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
from random import randint
|
|
2
|
-
from Time import uptime
|
|
3
|
-
from Types import resolve
|
|
4
|
-
from microIO import detect_platform
|
|
5
|
-
from Common import console
|
|
6
|
-
|
|
7
|
-
CNT = 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def _debug(func):
|
|
11
|
-
"""
|
|
12
|
-
Debug wrapper
|
|
13
|
-
- console logging
|
|
14
|
-
- handled cmd counter (exec_info to get the value)
|
|
15
|
-
"""
|
|
16
|
-
def __wrapper(*args, **kwargs):
|
|
17
|
-
global CNT
|
|
18
|
-
CNT += 1
|
|
19
|
-
console("debug module cmd executed") # + Progress LED
|
|
20
|
-
return func(*args, **kwargs)
|
|
21
|
-
return __wrapper
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def load():
|
|
25
|
-
"""
|
|
26
|
-
Initialize demo module
|
|
27
|
-
"""
|
|
28
|
-
return "demo module - loaded"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@_debug
|
|
32
|
-
def hello(name="MrNobody"):
|
|
33
|
-
return f"Hello {name}! This is a micrOS smart endpoint ☁️, running on {detect_platform()}.\
|
|
34
|
-
\nFor more info call `demo links` function :D"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@_debug
|
|
38
|
-
def calculator(a, b, op="+"):
|
|
39
|
-
if op.strip() == "+":
|
|
40
|
-
return f"{a} + {b} = {a + b}"
|
|
41
|
-
if op.strip() == "-":
|
|
42
|
-
return f"{a} - {b} = {a - b}"
|
|
43
|
-
if op.strip() == "/":
|
|
44
|
-
return f"{a} / {b} = {round(a / b, 3)}"
|
|
45
|
-
if op.strip() == "*":
|
|
46
|
-
return f"{a} * {b} = {a * b}"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
@_debug
|
|
50
|
-
def dice_cube():
|
|
51
|
-
value = randint(1, 6)
|
|
52
|
-
return f"🎲 {value}"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@_debug
|
|
56
|
-
def yes_no():
|
|
57
|
-
val = randint(0, 1)
|
|
58
|
-
return 'NO👎' if val == 0 else 'YES👍'
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@_debug
|
|
62
|
-
def links():
|
|
63
|
-
descript = f"Platform: {detect_platform()}\nGITHUB: https://github.com/BxNxM/micrOS\nYOUTUBE: https://www.youtube.com/@micrOSframework\nINSTAGRAM: https://instagram.com/micros_framework"
|
|
64
|
-
return descript
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
@_debug
|
|
68
|
-
def source():
|
|
69
|
-
return 'https://github.com/BxNxM/micrOS/blob/master/micrOS/source/LM_demo.py'
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
@_debug
|
|
73
|
-
def exec_info():
|
|
74
|
-
global CNT
|
|
75
|
-
return f"Under {uptime()}: {CNT} cmd served."
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
@_debug
|
|
79
|
-
def help(widgets=False):
|
|
80
|
-
"""
|
|
81
|
-
[i] micrOS LM naming convention - built-in help message
|
|
82
|
-
:return tuple:
|
|
83
|
-
(widgets=False) list of functions implemented by this application
|
|
84
|
-
(widgets=True) list of widget json for UI generation
|
|
85
|
-
"""
|
|
86
|
-
return resolve(('hello name="MrNobody"',
|
|
87
|
-
'calculator a b op="+"',
|
|
88
|
-
'\t=>op: + - / *',
|
|
89
|
-
'BUTTON dice_cube',
|
|
90
|
-
'dice_cube - show number, roll a dice',
|
|
91
|
-
'BUTTON yes_no',
|
|
92
|
-
'yes_no - show random yes/no',
|
|
93
|
-
'links - show micrOS links',
|
|
94
|
-
'source - show demo module source code',
|
|
95
|
-
'TEXTBOX exec_info',
|
|
96
|
-
'exec_info - Execution info, demo module usage',
|
|
97
|
-
'load'), widgets=widgets)
|
micrOS/source/LM_espnow.py
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import Espnow
|
|
2
|
-
|
|
3
|
-
def load():
|
|
4
|
-
return Espnow.initialize()
|
|
5
|
-
|
|
6
|
-
def send(peer, msg='ping'):
|
|
7
|
-
return Espnow.espnow_send(peer, msg)
|
|
8
|
-
|
|
9
|
-
def start_server():
|
|
10
|
-
return Espnow.espnow_server()
|
|
11
|
-
|
|
12
|
-
def stats():
|
|
13
|
-
return Espnow.stats()
|
|
14
|
-
|
|
15
|
-
def add_peer(peer):
|
|
16
|
-
now = Espnow.initialize()
|
|
17
|
-
return Espnow.add_peer(now, peer)
|
|
18
|
-
|
|
19
|
-
def mac_address():
|
|
20
|
-
return Espnow.mac_address()
|
|
21
|
-
|
|
22
|
-
def help():
|
|
23
|
-
return 'load', 'send <peer> "ping"', 'start_server', 'add_peer <peer>', 'stats', 'mac_address'
|
micrOS/source/LM_intercon.py
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
from InterConnect import send_cmd, host_cache
|
|
2
|
-
from Common import syslog
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def sendcmd(*args, **kwargs):
|
|
6
|
-
"""
|
|
7
|
-
Implements send command function towards micrOS devices
|
|
8
|
-
example: sendcmd "hello" host="IP/hostname.local") OR sendcmd host="IP/hostname.local" cmd="system rssi")
|
|
9
|
-
:param host[0]: host IP or Hostname
|
|
10
|
-
:param cmd[1]: command - module func arg(s)
|
|
11
|
-
:return str: reply
|
|
12
|
-
"""
|
|
13
|
-
def __send(_host, _cmd):
|
|
14
|
-
try:
|
|
15
|
-
out = send_cmd(_host, _cmd)
|
|
16
|
-
except Exception as e:
|
|
17
|
-
out = []
|
|
18
|
-
syslog(f'[intercon] sendcmd: {e}')
|
|
19
|
-
return out
|
|
20
|
-
|
|
21
|
-
host = kwargs.get('host', None)
|
|
22
|
-
cmd = kwargs.get('cmd', None)
|
|
23
|
-
|
|
24
|
-
# Host correction (lm_exec) if keyword-arg 'host' was not found
|
|
25
|
-
if host is None:
|
|
26
|
-
host = args[0]
|
|
27
|
-
args = args[1:]
|
|
28
|
-
|
|
29
|
-
# Cmd correction (lm_exec) if keyword-arg was not found
|
|
30
|
-
if cmd is None:
|
|
31
|
-
cmd = ''.join(args)
|
|
32
|
-
return __send(host, cmd)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def addr_cache():
|
|
36
|
-
"""
|
|
37
|
-
Dump intercon connection cache
|
|
38
|
-
:return dict: device-ip pairs
|
|
39
|
-
"""
|
|
40
|
-
return host_cache()
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
#######################
|
|
44
|
-
# LM helper functions #
|
|
45
|
-
#######################
|
|
46
|
-
|
|
47
|
-
def help(widgets=False):
|
|
48
|
-
"""
|
|
49
|
-
[i] micrOS LM naming convention - built-in help message
|
|
50
|
-
:return tuple:
|
|
51
|
-
(widgets=False) list of functions implemented by this application
|
|
52
|
-
(widgets=True) list of widget json for UI generation
|
|
53
|
-
"""
|
|
54
|
-
return 'sendcmd "hello" host="IP/hostname.local")',\
|
|
55
|
-
'sendcmd host="IP/hostname.local" cmd="system rssi")',\
|
|
56
|
-
'example: intercon sendcmd "10.0.1.84" "system rssi" OR intercon sendcmd "system rssi" host="node01.local"', \
|
|
57
|
-
'addr_cache'
|
micrOS/source/LM_keychain.py
DELETED
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
from utime import localtime, sleep_ms
|
|
2
|
-
from neopixel import NeoPixel
|
|
3
|
-
from machine import Pin
|
|
4
|
-
from Common import micro_task
|
|
5
|
-
from microIO import resolve_pin, pinmap_search
|
|
6
|
-
from LM_oled import text, show, rect, pixel, clean, line, load as oled_lni
|
|
7
|
-
from LM_ds18 import measure
|
|
8
|
-
from LM_system import top, ifconfig
|
|
9
|
-
try:
|
|
10
|
-
from LM_gameOfLife import next_gen as gol_nextgen, reset as gol_reset
|
|
11
|
-
except:
|
|
12
|
-
gol_nextgen = None # Optional function handling
|
|
13
|
-
|
|
14
|
-
class KC:
|
|
15
|
-
INITED = False # Auto init module feature
|
|
16
|
-
DP_main_page = True # store display logical state: ON (main page) / OFF (screen saver)
|
|
17
|
-
DP_cnt = 0 # display "count back", when 0 go to sleep -> OFF
|
|
18
|
-
DP_cnt_default = None # store calculated sequence to sleep 30sec/period_ms
|
|
19
|
-
NEOPIXEL_OBJ = None # Neopixel LED handler object
|
|
20
|
-
COLOR_WHEEL = None # LED color wheel generator object for animation
|
|
21
|
-
NEOPIXEL_BR = 20 # default neopixel brightness
|
|
22
|
-
|
|
23
|
-
#############################
|
|
24
|
-
# INTERNAL FUNCTIONS #
|
|
25
|
-
#############################
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
async def _screen_saver(scale=2):
|
|
29
|
-
"""
|
|
30
|
-
Conway's game of life screen saver simulation
|
|
31
|
-
:param scale: default (2) game of life matrix (16x32) upscale to real display size 32x64
|
|
32
|
-
"""
|
|
33
|
-
# Default mode
|
|
34
|
-
if gol_nextgen is None:
|
|
35
|
-
return # screen off - no screen saver...
|
|
36
|
-
# Screen saver mode
|
|
37
|
-
matrix = gol_nextgen(raw=True)
|
|
38
|
-
if matrix is None:
|
|
39
|
-
# Reset Game of life
|
|
40
|
-
gol_reset()
|
|
41
|
-
# quick view - show (enable) main page
|
|
42
|
-
KC.DP_main_page = True
|
|
43
|
-
else:
|
|
44
|
-
# Update display with Conway's Game of Life
|
|
45
|
-
clean()
|
|
46
|
-
for line_idx, _line in enumerate(matrix):
|
|
47
|
-
for x_idx, v in enumerate(_line):
|
|
48
|
-
if scale == 1:
|
|
49
|
-
pixel(x_idx, line_idx, color=v)
|
|
50
|
-
else:
|
|
51
|
-
rect(x_idx*scale, line_idx*scale, w=scale, h=scale, state=v, fill=True)
|
|
52
|
-
show()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def __color_wheel():
|
|
56
|
-
"""
|
|
57
|
-
RGB LED color wheel generator - rainbow
|
|
58
|
-
"""
|
|
59
|
-
max_val = 10 # normally up to 255, but must be limited due to heat problems (4%)
|
|
60
|
-
half_val = max_val // 2
|
|
61
|
-
colors = ((0, 0, half_val), (0, 0, max_val), (0, half_val, max_val), (0, max_val, half_val), (0, max_val, 0),
|
|
62
|
-
(half_val, max_val, 0), (max_val, half_val, 0), (max_val, 0, 0), (half_val, 0, 0), (max_val, 0, half_val),
|
|
63
|
-
(half_val, 0, max_val), (0, 0, half_val))
|
|
64
|
-
while True:
|
|
65
|
-
# Loop through the colors to generate smooth transitions
|
|
66
|
-
for i in range(len(colors) - 1):
|
|
67
|
-
start_color = colors[i]
|
|
68
|
-
end_color = colors[i + 1]
|
|
69
|
-
# Generate a smooth transition from start_color to end_color
|
|
70
|
-
for j in range(5): # Adjust this value for smoother or faster transition
|
|
71
|
-
# Linear interpolation for each color component
|
|
72
|
-
yield tuple(int(start + (end - start) * j / 10) for start, end in zip(start_color, end_color))
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
async def _main_page():
|
|
76
|
-
"""
|
|
77
|
-
Run display content refresh
|
|
78
|
-
# H:M
|
|
79
|
-
S/A: 1.92
|
|
80
|
-
40.0 C
|
|
81
|
-
"""
|
|
82
|
-
def _timer():
|
|
83
|
-
# 5x5 px cube (25px overall)
|
|
84
|
-
_offset, _l_width = 2, 5 # Initial size + positioning
|
|
85
|
-
_view = int(25*(KC.DP_cnt/KC.DP_cnt_default)) # overall pixel to be visualized
|
|
86
|
-
_complete_lines = int(_view / _l_width) # complete lines number
|
|
87
|
-
_sub_line = _view - (_complete_lines*_l_width) # incomplete line width
|
|
88
|
-
for _l in range(0, 5):
|
|
89
|
-
if _l < _complete_lines:
|
|
90
|
-
line(0+_offset, _l+_offset, _l_width+_offset, _l+_offset)
|
|
91
|
-
else:
|
|
92
|
-
line(0+_offset, _l+_offset, _sub_line+_offset, _l+_offset)
|
|
93
|
-
break
|
|
94
|
-
|
|
95
|
-
def _cpu_mem():
|
|
96
|
-
sys_usage = top()
|
|
97
|
-
cpu = sys_usage.get('CPU load [%]', 100)
|
|
98
|
-
cpu = 100 if cpu > 100 else cpu # limit cpu overload in visualization
|
|
99
|
-
mem = sys_usage.get('Mem usage [%]', 100)
|
|
100
|
-
_cpu_limit, _mem_limit = cpu > 90, mem > 70 # fill indicator (limit)
|
|
101
|
-
_offset, _height = 1, 6
|
|
102
|
-
_cpu, _mem = int(_height * (cpu/100)), int(_height * (mem/100))
|
|
103
|
-
rect(55, _height+_offset-_cpu, w=3, h=_cpu+_offset, fill=_cpu_limit) # cpu usage indicator
|
|
104
|
-
rect(60, _height+_offset-_mem, w=3, h=_mem+_offset, fill=_mem_limit) # memory usage indicator
|
|
105
|
-
|
|
106
|
-
# Clean display and collect input data: time, network mode, IP address
|
|
107
|
-
clean()
|
|
108
|
-
ltime = localtime()
|
|
109
|
-
h = f"0{ltime[-5]}" if len(str(ltime[-5])) < 2 else ltime[-5]
|
|
110
|
-
m = f"0{ltime[-4]}" if len(str(ltime[-4])) < 2 else ltime[-4]
|
|
111
|
-
nwmd, nwif = ifconfig()
|
|
112
|
-
nwmd, devip = nwmd[0] if len(nwmd) > 0 else "0", ".".join(nwif[0].split(".")[-2:])
|
|
113
|
-
|
|
114
|
-
# Draw data to display
|
|
115
|
-
_timer() # Draw display timer (until screen saver)
|
|
116
|
-
_cpu_mem() # Draw cpu and memory indicator
|
|
117
|
-
text(f"{h}:{m}", x=12, y=1) # Header: time
|
|
118
|
-
text(f"{nwmd}:{devip}", x=4, y=15) # Network mode and IP
|
|
119
|
-
try:
|
|
120
|
-
text(f"{round(tuple(measure().values())[0], 1)} C", x=4, y=25) # ds18 sensor value
|
|
121
|
-
except Exception:
|
|
122
|
-
text("? C", x=4, y=25) # ds18 read issue (default: ?)
|
|
123
|
-
show()
|
|
124
|
-
return "Display show"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
async def _ui_task(period_ms, tts_ms):
|
|
128
|
-
"""Async display refresh task
|
|
129
|
-
- main page (main mode)
|
|
130
|
-
- screen saver (sleep mode)
|
|
131
|
-
"""
|
|
132
|
-
# Auto init keychain module (if needed) - failsafe
|
|
133
|
-
if not KC.INITED:
|
|
134
|
-
_v = load()
|
|
135
|
-
if not KC.INITED:
|
|
136
|
-
return _v
|
|
137
|
-
|
|
138
|
-
KC.DP_cnt_default = int(tts_ms / period_ms) # After 30 sec go to sleep mode
|
|
139
|
-
KC.DP_cnt = KC.DP_cnt_default # Set sleep counter
|
|
140
|
-
fast_period = int(period_ms/3) # Calculate faster refresh period
|
|
141
|
-
fast_period = fast_period if fast_period > 100 else 100
|
|
142
|
-
|
|
143
|
-
# Run keychain main async loop, with update ID: keychain.display
|
|
144
|
-
with micro_task(tag="keychain.display") as my_task:
|
|
145
|
-
while True:
|
|
146
|
-
if KC.DP_main_page:
|
|
147
|
-
# [MAIN MODE] Execute main page
|
|
148
|
-
await _main_page() #1 Run main page function
|
|
149
|
-
my_task.out = f'main page: {KC.DP_cnt}' #2 Update task data for (task show keychain.display)
|
|
150
|
-
KC.DP_cnt -= 1 #3 Update sleep counter
|
|
151
|
-
# Async sleep - feed event loop
|
|
152
|
-
await my_task.feed(sleep_ms=period_ms)
|
|
153
|
-
else:
|
|
154
|
-
# [SLEEP MODE] Execute screen saver page
|
|
155
|
-
await _screen_saver() # Run sleep page function
|
|
156
|
-
# Async sleep - feed event loop
|
|
157
|
-
await my_task.feed(sleep_ms=fast_period)
|
|
158
|
-
|
|
159
|
-
# Auto sleep event handler - off event - go to (sleep mode)
|
|
160
|
-
if KC.DP_cnt <= 0:
|
|
161
|
-
KC.DP_main_page = False #1 disable main screen
|
|
162
|
-
clean() #2 clean screen
|
|
163
|
-
show() #3 show cleaned display
|
|
164
|
-
KC.DP_cnt = KC.DP_cnt_default #4 reset sleep counter to default
|
|
165
|
-
my_task.out = 'sleep...'
|
|
166
|
-
color_wheel() # update neopixel color wheel
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
#############################
|
|
170
|
-
# PUBLIC FUNCTIONS #
|
|
171
|
-
#############################
|
|
172
|
-
|
|
173
|
-
def load(width=64, height=32, bootmsg="micrOS"):
|
|
174
|
-
"""
|
|
175
|
-
Init OLED display 64x32 (default)
|
|
176
|
-
Init Neopixel LED (1 segment)
|
|
177
|
-
:param width: screen width (pixel)
|
|
178
|
-
:param height: screen height (pixel)
|
|
179
|
-
:param bootmsg: First text on page at bootup, default: "micrOS"
|
|
180
|
-
"""
|
|
181
|
-
KC.COLOR_WHEEL = __color_wheel() #1 Init neopixel color wheel generator
|
|
182
|
-
try:
|
|
183
|
-
oled_lni(width, height, brightness=20) #2 Init oled display
|
|
184
|
-
msgbox(bootmsg, width) #3 Show boot page text
|
|
185
|
-
KC.INITED = True # Set display was successfully inited (for _task auto init)
|
|
186
|
-
return "OLED INIT OK"
|
|
187
|
-
except Exception as e:
|
|
188
|
-
KC.INITED = False # display init failed (for _task auto init)
|
|
189
|
-
return f"OLED INIT NOK: {e}"
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
def msgbox(msg, width=64):
|
|
193
|
-
clean()
|
|
194
|
-
chunk_size, char_height, line_limit = 8, 10, 3
|
|
195
|
-
# Format message: fitting and \n parsing
|
|
196
|
-
msg = msg.split('\n')
|
|
197
|
-
chunks = [line[i:i + chunk_size] for line in msg for i in range(0, len(line), chunk_size)]
|
|
198
|
-
for i, line in enumerate(chunks):
|
|
199
|
-
if i > line_limit - 1: # max line_limit lines of 13 char
|
|
200
|
-
break
|
|
201
|
-
start_x = int((width - len(line)*8)/2)
|
|
202
|
-
start_y = char_height * i
|
|
203
|
-
for k in range(0, len(line)):
|
|
204
|
-
text(line[0:k+1], start_x, start_y)
|
|
205
|
-
show()
|
|
206
|
-
sleep_ms(100)
|
|
207
|
-
sleep_ms(2000)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
def display(period=1000, tts=30):
|
|
211
|
-
"""
|
|
212
|
-
Create keychain.display task - refresh loop
|
|
213
|
-
:param period: display refresh period in ms (min. 500ms)
|
|
214
|
-
:param tts: time to sleep (in seconds)
|
|
215
|
-
"""
|
|
216
|
-
# [!] ASYNC TASK CREATION [1*] with async task callback + taskID (TAG) handling
|
|
217
|
-
period_ms = 500 if period < 500 else period
|
|
218
|
-
tts_ms = 5000 if tts < 5 else tts*1000
|
|
219
|
-
state = micro_task(tag="keychain.display", task=_ui_task(period_ms, tts_ms))
|
|
220
|
-
return "Starting" if state else "Already running"
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
def temperature():
|
|
224
|
-
"""
|
|
225
|
-
Measure ds18B20 temperature sensor
|
|
226
|
-
"""
|
|
227
|
-
return measure()
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
def color_wheel(br=None):
|
|
231
|
-
"""
|
|
232
|
-
Neopixel color wheel
|
|
233
|
-
:param br: brightness value 0-100 percent
|
|
234
|
-
"""
|
|
235
|
-
def _init():
|
|
236
|
-
if KC.NEOPIXEL_OBJ is None:
|
|
237
|
-
neopixel_pin = Pin(resolve_pin('neop')) # Get Neopixel pin from LED PIN pool
|
|
238
|
-
KC.NEOPIXEL_OBJ = NeoPixel(neopixel_pin, n=1) # initialize for max 1 segment
|
|
239
|
-
return KC.NEOPIXEL_OBJ
|
|
240
|
-
# INIT
|
|
241
|
-
neo_led = _init()
|
|
242
|
-
if br is None or not isinstance(br, int): # Optional brightness param handling (load from cache)
|
|
243
|
-
br = KC.NEOPIXEL_BR
|
|
244
|
-
else:
|
|
245
|
-
KC.NEOPIXEL_BR = br # update neopixel brightness cache
|
|
246
|
-
if KC.COLOR_WHEEL is None:
|
|
247
|
-
KC.COLOR_WHEEL = __color_wheel() # init color wheel generator
|
|
248
|
-
# UPDATE
|
|
249
|
-
r, g, b = next(KC.COLOR_WHEEL) # get next color
|
|
250
|
-
br = br if br == 100 else br/100 # calculate brightness multiplier
|
|
251
|
-
r, g, b = int(r*br), int(g*br), int(b*br) # apply brightness parameter
|
|
252
|
-
neo_led[0] = (r, g, b) # Set LED element color
|
|
253
|
-
neo_led.write() # Send data to LED device
|
|
254
|
-
return {'R': r, 'G': g, 'B': b, 'S': 1, 'br': br} # Return verdict
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
def display_toggle():
|
|
258
|
-
"""
|
|
259
|
-
Display mode toggle (main/screensaver)
|
|
260
|
-
"""
|
|
261
|
-
KC.DP_main_page = not KC.DP_main_page
|
|
262
|
-
if not KC.DP_main_page:
|
|
263
|
-
# Reset display counter when goes to sleep
|
|
264
|
-
KC.DP_cnt = KC.DP_cnt_default
|
|
265
|
-
v = 'main view' if KC.DP_main_page else 'screensaver'
|
|
266
|
-
return f"Display mode: {v}"
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
def neopixel_toggle():
|
|
270
|
-
"""
|
|
271
|
-
Disable/Enable neopixel LED (brightness 0/default)
|
|
272
|
-
"""
|
|
273
|
-
KC.NEOPIXEL_BR = 0 if KC.NEOPIXEL_BR > 0 else 20
|
|
274
|
-
v = 'disabled' if KC.NEOPIXEL_BR == 0 else 'enabled'
|
|
275
|
-
return f"Neopixel: {v} br: {KC.NEOPIXEL_BR}"
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
def button():
|
|
279
|
-
"""
|
|
280
|
-
IRQ1 keychain module control function
|
|
281
|
-
- neopixel ON/OFF
|
|
282
|
-
- display wake-up (ON)
|
|
283
|
-
"""
|
|
284
|
-
# If display is ON call neopixel toggle function
|
|
285
|
-
if KC.DP_main_page:
|
|
286
|
-
# Reset display counter
|
|
287
|
-
KC.DP_cnt = KC.DP_cnt_default
|
|
288
|
-
# Neopixel color wheel disable/enable
|
|
289
|
-
return neopixel_toggle()
|
|
290
|
-
# Wake display
|
|
291
|
-
KC.DP_main_page = True
|
|
292
|
-
return "Display mode: main view"
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
def pinmap():
|
|
296
|
-
"""
|
|
297
|
-
PIN MAP dump
|
|
298
|
-
"""
|
|
299
|
-
from LM_oled import pinmap as o_pmp
|
|
300
|
-
from LM_ds18 import pinmap as t_pmp
|
|
301
|
-
pmp = o_pmp()
|
|
302
|
-
pmp.update(t_pmp())
|
|
303
|
-
pmp.update(pinmap_search(['neop']))
|
|
304
|
-
return pmp
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
def help(widgets=False):
|
|
308
|
-
"""
|
|
309
|
-
[i] micrOS LM naming convention - built-in help message
|
|
310
|
-
:return tuple:
|
|
311
|
-
(widgets=False) list of functions implemented by this application
|
|
312
|
-
(widgets=True) list of widget json for UI generation
|
|
313
|
-
"""
|
|
314
|
-
return ('load width=64 height=32 bootmsg="micrOS"',
|
|
315
|
-
'msgbox msg="micrOS"',
|
|
316
|
-
'temperature',
|
|
317
|
-
'display period>=1000 tts=30',
|
|
318
|
-
'button',
|
|
319
|
-
'display_toggle',
|
|
320
|
-
'neopixel_toggle',
|
|
321
|
-
'color_wheel br=<0-100>',
|
|
322
|
-
'pinmap')
|