micrOSDevToolKit 2.10.6__py3-none-any.whl → 2.11.0__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.
Potentially problematic release.
This version of micrOSDevToolKit might be problematic. Click here for more details.
- 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/esp32c6-GENERIC-20250415-v1.25.0.bin +0 -0
- micrOS/micropython/esp32s3-4MBflash-20241129-v1.24.1.bin +0 -0
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +45 -49
- micrOS/source/Common.py +262 -87
- micrOS/source/Debug.py +44 -88
- micrOS/source/Espnow.py +1 -1
- micrOS/source/Files.py +21 -2
- micrOS/source/Hooks.py +60 -17
- micrOS/source/IO_esp32c6.py +16 -0
- micrOS/source/IO_esp32s3.py +37 -1
- micrOS/source/IO_m5stamp.py +35 -1
- micrOS/source/IO_qtpy.py +22 -17
- micrOS/source/IO_s3matrix.py +21 -0
- micrOS/source/IO_tinypico.py +38 -0
- micrOS/source/LM_VL53L0X.py +1 -1
- micrOS/source/LM_buzzer.py +6 -7
- micrOS/source/LM_cct.py +6 -5
- micrOS/source/LM_dimmer.py +6 -5
- micrOS/source/LM_espnow.py +15 -10
- micrOS/source/LM_i2c.py +3 -2
- micrOS/source/LM_neoeffects.py +173 -230
- micrOS/source/LM_neomatrix.py +305 -0
- micrOS/source/LM_neopixel.py +10 -10
- micrOS/source/LM_pacman.py +25 -21
- micrOS/source/LM_qmi8658.py +204 -0
- micrOS/source/LM_rgb.py +6 -6
- micrOS/source/LM_roboarm.py +5 -4
- micrOS/source/LM_switch.py +6 -4
- micrOS/source/LM_tcs3472.py +75 -0
- micrOS/source/LM_telegram.py +5 -4
- micrOS/source/Logger.py +46 -32
- micrOS/source/Shell.py +1 -1
- micrOS/source/Tasks.py +7 -4
- micrOS/source/Time.py +5 -3
- micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
- micrOS/source/micrOS.py +5 -2
- micrOS/source/microIO.py +8 -6
- {microsdevtoolkit-2.10.6.dist-info → microsdevtoolkit-2.11.0.dist-info}/METADATA +2 -1
- {microsdevtoolkit-2.10.6.dist-info → microsdevtoolkit-2.11.0.dist-info}/RECORD +92 -87
- toolkit/DevEnvUSB.py +5 -0
- toolkit/LM_to_compile.dat +1 -0
- toolkit/dashboard_apps/NeoEffectsDemo.py +8 -15
- toolkit/dashboard_apps/QMI8685_GYRO.py +68 -0
- toolkit/dashboard_apps/_app_base.py +2 -2
- toolkit/dashboard_apps/_gyro_visualizer.py +78 -0
- toolkit/simulator_lib/__pycache__/IO_darwin.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/neopixel.cpython-312.pyc +0 -0
- toolkit/simulator_lib/machine.py +0 -1
- toolkit/simulator_lib/neopixel.py +3 -2
- toolkit/socketClient.py +3 -2
- toolkit/workspace/precompiled/Common.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/IO_esp32c6.mpy +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_s3matrix.mpy +0 -0
- toolkit/workspace/precompiled/IO_tinypico.mpy +0 -0
- toolkit/workspace/precompiled/LM_VL53L0X.py +1 -1
- toolkit/workspace/precompiled/LM_buzzer.mpy +0 -0
- toolkit/workspace/precompiled/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/LM_espnow.py +15 -10
- toolkit/workspace/precompiled/LM_i2c.py +3 -2
- toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/LM_neomatrix.mpy +0 -0
- toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/LM_pacman.mpy +0 -0
- toolkit/workspace/precompiled/LM_qmi8658.py +204 -0
- toolkit/workspace/precompiled/LM_rgb.mpy +0 -0
- toolkit/workspace/precompiled/LM_roboarm.mpy +0 -0
- toolkit/workspace/precompiled/LM_switch.mpy +0 -0
- toolkit/workspace/precompiled/LM_tcs3472.py +75 -0
- toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/Logger.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/micrOS.mpy +0 -0
- toolkit/workspace/precompiled/microIO.mpy +0 -0
- micrOS/micropython/esp32s3-20240105-v1.22.1.bin +0 -0
- micrOS/source/LM_catgame.py +0 -75
- micrOS/source/LM_demo.py +0 -97
- micrOS/source/LM_intercon.py +0 -60
- micrOS/source/LM_ph_sensor.py +0 -51
- toolkit/workspace/precompiled/LM_catgame.py +0 -75
- toolkit/workspace/precompiled/LM_demo.py +0 -97
- toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
- toolkit/workspace/precompiled/LM_ph_sensor.py +0 -51
- /micrOS/micropython/{esp32s3-20241129-v1.24.1.bin → esp32s3-8MBflash-20241129-v1.24.1.bin} +0 -0
- {microsdevtoolkit-2.10.6.data → microsdevtoolkit-2.11.0.data}/scripts/devToolKit.py +0 -0
- {microsdevtoolkit-2.10.6.dist-info → microsdevtoolkit-2.11.0.dist-info}/WHEEL +0 -0
- {microsdevtoolkit-2.10.6.dist-info → microsdevtoolkit-2.11.0.dist-info}/licenses/LICENSE +0 -0
- {microsdevtoolkit-2.10.6.dist-info → microsdevtoolkit-2.11.0.dist-info}/top_level.txt +0 -0
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_intercon.py
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
from InterConnect import send_cmd, host_cache
|
|
2
|
-
from Common import syslog
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def sendcmd(*args, **kwargs):
|
|
6
|
-
"""
|
|
7
|
-
[!!!] OBSOLETE - NEW SYNTAX: system top >>node01.local
|
|
8
|
-
Implements send command function towards micrOS devices
|
|
9
|
-
example: sendcmd "hello" host="IP/hostname.local") OR sendcmd host="IP/hostname.local" cmd="system rssi")
|
|
10
|
-
:param host[0]: host IP or Hostname
|
|
11
|
-
:param cmd[1]: command - module func arg(s)
|
|
12
|
-
:return str: reply
|
|
13
|
-
"""
|
|
14
|
-
def __send(_host, _cmd):
|
|
15
|
-
try:
|
|
16
|
-
out = send_cmd(_host, _cmd)
|
|
17
|
-
except Exception as e:
|
|
18
|
-
out = []
|
|
19
|
-
syslog(f'[intercon] sendcmd: {e}')
|
|
20
|
-
return out
|
|
21
|
-
|
|
22
|
-
host = kwargs.get('host', None)
|
|
23
|
-
cmd = kwargs.get('cmd', None)
|
|
24
|
-
|
|
25
|
-
# Host correction (lm_exec) if keyword-arg 'host' was not found
|
|
26
|
-
if host is None:
|
|
27
|
-
host = args[0]
|
|
28
|
-
args = args[1:]
|
|
29
|
-
|
|
30
|
-
# Cmd correction (lm_exec) if keyword-arg was not found
|
|
31
|
-
if cmd is None:
|
|
32
|
-
cmd = ''.join(args)
|
|
33
|
-
return __send(host, cmd)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def addr_cache():
|
|
37
|
-
"""
|
|
38
|
-
[!!!] OBSOLETE -> new command: system hosts
|
|
39
|
-
Dump intercon connection cache
|
|
40
|
-
:return dict: device-ip pairs
|
|
41
|
-
"""
|
|
42
|
-
return host_cache()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
#######################
|
|
46
|
-
# LM helper functions #
|
|
47
|
-
#######################
|
|
48
|
-
|
|
49
|
-
def help(widgets=False):
|
|
50
|
-
"""
|
|
51
|
-
[!!!] OBSOLETE
|
|
52
|
-
[i] micrOS LM naming convention - built-in help message
|
|
53
|
-
:return tuple:
|
|
54
|
-
(widgets=False) list of functions implemented by this application
|
|
55
|
-
(widgets=True) list of widget json for UI generation
|
|
56
|
-
"""
|
|
57
|
-
return 'sendcmd "hello" host="IP/hostname.local")',\
|
|
58
|
-
'sendcmd host="IP/hostname.local" cmd="system rssi")',\
|
|
59
|
-
'example: intercon sendcmd "10.0.1.84" "system rssi" OR intercon sendcmd "system rssi" host="node01.local"', \
|
|
60
|
-
'addr_cache'
|
micrOS/source/LM_ph_sensor.py
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
from time import sleep
|
|
2
|
-
from microIO import bind_pin, pinmap_search
|
|
3
|
-
from Common import SmartADC
|
|
4
|
-
|
|
5
|
-
"""
|
|
6
|
-
https://cimpleo.com/blog/simple-arduino-ph-meter/
|
|
7
|
-
ADC.ATTN_0DB — the full range voltage: 1.2V
|
|
8
|
-
ADC.ATTN_2_5DB — the full range voltage: 1.5V
|
|
9
|
-
ADC.ATTN_6DB — the full range voltage: 2.0V
|
|
10
|
-
ADC.ATTN_11DB — the full range voltage: 3.3V
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def __measure(samples=10):
|
|
15
|
-
adc_obj = SmartADC.get_instance(bind_pin('ph'))
|
|
16
|
-
mbuf = 0
|
|
17
|
-
for k in range(0, samples):
|
|
18
|
-
mbuf += adc_obj.get()['volt']
|
|
19
|
-
sleep(0.1)
|
|
20
|
-
voltage = round(mbuf / samples, 3)
|
|
21
|
-
return voltage
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def measure():
|
|
25
|
-
data = SmartADC.get_instance(bind_pin('ph')).get()
|
|
26
|
-
return "ADC data: {}\nAVG V: {}".format(data, __measure())
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#######################
|
|
30
|
-
# LM helper functions #
|
|
31
|
-
#######################
|
|
32
|
-
|
|
33
|
-
def pinmap():
|
|
34
|
-
"""
|
|
35
|
-
[i] micrOS LM naming convention
|
|
36
|
-
Shows logical pins - pin number(s) used by this Load module
|
|
37
|
-
- info which pins to use for this application
|
|
38
|
-
:return dict: pin name (str) - pin value (int) pairs
|
|
39
|
-
"""
|
|
40
|
-
return pinmap_search('ph')
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def help(widgets=False):
|
|
44
|
-
"""
|
|
45
|
-
[BETA][i] micrOS LM naming convention - built-in help message
|
|
46
|
-
:return tuple:
|
|
47
|
-
(widgets=False) list of functions implemented by this application
|
|
48
|
-
(widgets=True) list of widget json for UI generation
|
|
49
|
-
"""
|
|
50
|
-
return 'measure', 'pinmap'
|
|
51
|
-
|
|
@@ -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)
|
|
@@ -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)
|
|
Binary file
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
from time import sleep
|
|
2
|
-
from microIO import bind_pin, pinmap_search
|
|
3
|
-
from Common import SmartADC
|
|
4
|
-
|
|
5
|
-
"""
|
|
6
|
-
https://cimpleo.com/blog/simple-arduino-ph-meter/
|
|
7
|
-
ADC.ATTN_0DB — the full range voltage: 1.2V
|
|
8
|
-
ADC.ATTN_2_5DB — the full range voltage: 1.5V
|
|
9
|
-
ADC.ATTN_6DB — the full range voltage: 2.0V
|
|
10
|
-
ADC.ATTN_11DB — the full range voltage: 3.3V
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def __measure(samples=10):
|
|
15
|
-
adc_obj = SmartADC.get_instance(bind_pin('ph'))
|
|
16
|
-
mbuf = 0
|
|
17
|
-
for k in range(0, samples):
|
|
18
|
-
mbuf += adc_obj.get()['volt']
|
|
19
|
-
sleep(0.1)
|
|
20
|
-
voltage = round(mbuf / samples, 3)
|
|
21
|
-
return voltage
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def measure():
|
|
25
|
-
data = SmartADC.get_instance(bind_pin('ph')).get()
|
|
26
|
-
return "ADC data: {}\nAVG V: {}".format(data, __measure())
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#######################
|
|
30
|
-
# LM helper functions #
|
|
31
|
-
#######################
|
|
32
|
-
|
|
33
|
-
def pinmap():
|
|
34
|
-
"""
|
|
35
|
-
[i] micrOS LM naming convention
|
|
36
|
-
Shows logical pins - pin number(s) used by this Load module
|
|
37
|
-
- info which pins to use for this application
|
|
38
|
-
:return dict: pin name (str) - pin value (int) pairs
|
|
39
|
-
"""
|
|
40
|
-
return pinmap_search('ph')
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def help(widgets=False):
|
|
44
|
-
"""
|
|
45
|
-
[BETA][i] micrOS LM naming convention - built-in help message
|
|
46
|
-
:return tuple:
|
|
47
|
-
(widgets=False) list of functions implemented by this application
|
|
48
|
-
(widgets=True) list of widget json for UI generation
|
|
49
|
-
"""
|
|
50
|
-
return 'measure', 'pinmap'
|
|
51
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|