Skip to content

Commit 932e266

Browse files
Tinyu-Zhaolbuque
authored andcommitted
libs/module: Add HMI module.
Signed-off-by: Tinyu <[email protected]>
1 parent f69b000 commit 932e266

File tree

8 files changed

+488
-0
lines changed

8 files changed

+488
-0
lines changed

docs/en/module/hmi.rst

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
2+
HMI Module
3+
=========
4+
5+
.. include:: ../refs/module.hmi.ref
6+
7+
Support the following products:
8+
9+
|HMI Module|
10+
11+
Micropython Example::
12+
13+
import os, sys, io
14+
import M5
15+
from M5 import *
16+
from module import HMIModule
17+
import time
18+
19+
20+
title0 = None
21+
label0 = None
22+
label1 = None
23+
label2 = None
24+
label3 = None
25+
label4 = None
26+
label5 = None
27+
label6 = None
28+
hmi_0 = None
29+
30+
31+
led_a_state = None
32+
led_b_state = None
33+
btn_a_state = None
34+
btn_b_state = None
35+
36+
37+
def setup():
38+
global title0, label0, label1, label2, label3, label4, label5, label6, hmi_0, led_a_state, led_b_state, btn_a_state, btn_b_state
39+
40+
M5.begin()
41+
Widgets.fillScreen(0x222222)
42+
title0 = Widgets.Title("HMI Core2 Test", 3, 0xffffff, 0x0000FF, Widgets.FONTS.DejaVu18)
43+
label0 = Widgets.Label("Btn enc:", 0, 81, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
44+
label1 = Widgets.Label("Btn A:", 0, 129, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
45+
label2 = Widgets.Label("Btn B:", 0, 176, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
46+
label3 = Widgets.Label("Rotary:", 0, 37, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
47+
label4 = Widgets.Label("LED A:", 173, 106, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
48+
label5 = Widgets.Label("LED B:", 173, 164, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
49+
label6 = Widgets.Label("Rotary Inc:", 173, 41, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
50+
51+
hmi_0 = HMIModule(address=0x41)
52+
hmi_0.set_rotary_value(0)
53+
54+
55+
def loop():
56+
global title0, label0, label1, label2, label3, label4, label5, label6, hmi_0, led_a_state, led_b_state, btn_a_state, btn_b_state
57+
M5.update()
58+
led_a_state = hmi_0.get_led_state(1)
59+
led_b_state = hmi_0.get_led_state(2)
60+
btn_a_state = hmi_0.get_button_status(2)
61+
btn_b_state = hmi_0.get_button_status(3)
62+
label0.setText(str((str('Rotary:') + str((hmi_0.get_button_status(1))))))
63+
label1.setText(str((str('Btn A:') + str(btn_a_state))))
64+
label2.setText(str((str('Btn B:') + str(btn_b_state))))
65+
label4.setText(str((str('LED A:') + str(led_a_state))))
66+
label5.setText(str((str('LED B:') + str(led_b_state))))
67+
label3.setText(str((str('Enc:') + str((hmi_0.get_rotary_value())))))
68+
if hmi_0.get_button_status(1):
69+
label6.setText(str((str('Rotary Inc:') + str((hmi_0.get_rotary_increments())))))
70+
elif btn_a_state:
71+
led_a_state = not led_a_state
72+
hmi_0.set_led_state(1, led_a_state)
73+
elif btn_b_state:
74+
led_b_state = not led_b_state
75+
hmi_0.set_led_state(2, led_b_state)
76+
hmi_0.reset_rotary_value()
77+
time.sleep_ms(200)
78+
79+
80+
if __name__ == '__main__':
81+
try:
82+
setup()
83+
while True:
84+
loop()
85+
except (Exception, KeyboardInterrupt) as e:
86+
try:
87+
from utility import print_error_msg
88+
print_error_msg(e)
89+
except ImportError:
90+
print("please update to latest firmware")
91+
92+
93+
94+
UIFLOW2 Example:
95+
96+
|example.png|
97+
98+
.. only:: builder_html
99+
100+
|hmi_core2_example.m5f2|
101+
102+
class HMIModule
103+
---------------
104+
105+
Constructors
106+
------------
107+
108+
.. class:: HMIModule(address)
109+
110+
Init I2C Module HMI I2C Address.
111+
112+
:param int|list|tuple address: I2C address of the HMIModule.
113+
114+
UIFLOW2:
115+
116+
|init.png|
117+
118+
119+
Methods
120+
-------
121+
122+
.. method:: HMIModule.get_rotary_value() -> int
123+
124+
Get the current value of the rotary.
125+
126+
127+
UIFLOW2:
128+
129+
|get_rotary_value.png|
130+
131+
.. method:: HMIModule.set_rotary_value(value)
132+
133+
Set the rotary value.
134+
135+
:param int value: rotary value(-2147483648-2147483647).
136+
137+
138+
UIFLOW2:
139+
140+
|set_rotary_value.png|
141+
142+
.. method:: HMIModule.reset_rotary_value()
143+
144+
Reset the rotary value.
145+
146+
147+
UIFLOW2:
148+
149+
|reset_rotary_value.png|
150+
151+
.. method:: HMIModule.get_rotary_increments() -> int
152+
153+
Get the increment value of the rotary.
154+
155+
UIFLOW2:
156+
157+
|get_rotary_increments.png|
158+
159+
.. method:: HMIModule.get_button_status(btn_num) -> int
160+
161+
Get the state of a specific button.
162+
163+
:param int btn_num: : Button number (1 to 3).
164+
165+
UIFLOW2:
166+
167+
|get_button_status.png|
168+
169+
.. method:: HMIModule.get_led_state(led_num) -> int
170+
171+
Get the state of a specific LED.
172+
173+
:param int led_num: : LED number (1 to 2).
174+
175+
UIFLOW2:
176+
177+
|get_led_state.png|
178+
179+
.. method:: HMIModule.set_led_state(led_num, state)
180+
181+
Set the state of a specific LED.
182+
183+
:param int led_num: : LED number (1 to 2).
184+
:param int state: : The state to set for the LED.
185+
186+
UIFLOW2:
187+
188+
|set_led_state.png|
189+
190+
.. method:: HMIModule.get_firmware_version() -> int
191+
192+
Get the firmware version of the HMI module.
193+
194+
195+
UIFLOW2:
196+
197+
|get_firmware_version.png|
198+
199+
.. method:: HMIModule.get_i2c_address() -> int
200+
201+
Get the current I2C address of the HMI module.
202+
203+
UIFLOW2:
204+
205+
|get_i2c_address.png|
206+
207+
.. method:: HMIModule.set_i2c_address(addr)
208+
209+
Set a new I2C address for the HMI module.
210+
211+
:param int addr: : The new I2C address to set.
212+
213+
UIFLOW2:
214+
215+
|set_i2c_address.png|

docs/en/module/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ Module
77
ain4.rst
88
display.rst
99
dualkmeter.rst
10+
hmi.rst
1011
pps.rst
1112
rca.rst

docs/en/refs/module.hmi.ref

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
.. |HMI Module| image:: https://static-cdn.m5stack.com/resource/docs/products/module/HMI%20Module/img-4c227abf-0a4c-4e3a-b711-b81a35899aaf.webp
3+
:target: https://docs.m5stack.com/en/module/HMI%20Module
4+
:height: 200px
5+
:width: 200px
6+
7+
.. |init.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/init.png
8+
.. |get_rotary_value.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/get_encoder_value.png
9+
.. |set_rotary_value.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/set_encoder_value.png
10+
.. |reset_rotary.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/reset_encoder.png
11+
.. |get_rotary_increments.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/get_increment_value.png
12+
.. |get_button_status.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/get_button_state.png
13+
.. |get_led_state.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/get_led_state.png
14+
.. |set_led_state.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/set_led_state.png
15+
.. |get_firmware_version.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/get_firmware_version.png
16+
.. |get_i2c_address.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/get_i2c_address.png
17+
.. |set_i2c_address.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/set_i2c_address.png
18+
19+
.. |example.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/hmi/example.png
20+
21+
22+
.. |hmi_core2_example.m5f2| raw:: html
23+
24+
<a
25+
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/module/tmos/hmi_core2_example.m5f2"
26+
target="_blank"
27+
>
28+
hmi_core2_example.m5f2
29+
</a>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":"V2.0","versionNumber":"V2.1.2","type":"core2","components":[{"name":"screen","type":"screen","layer":0,"screenId":"builtin","screenName":"","id":"__core2_screen","createTime":1722824950443,"x":0,"y":0,"width":320,"height":240,"backgroundColor":"#222222","size":0,"isSelected":true},{"name":"title0","type":"title","layer":1,"screenId":"builtin","screenName":"","id":"u&#9^s3=e+JFdXqa","createTime":1722824959179,"x":0,"y":0,"color":"#ffffff","backgroundColor":"#0000FF","text":"HMI Core2 Test","textOffset":3,"font":"Widgets.FONTS.DejaVu18","isSelected":false},{"name":"label0","type":"label","layer":2,"screenId":"builtin","screenName":"","id":"k0CYIBWhjPYMY46w","createTime":1722824988901,"x":0,"y":81,"color":"#ffffff","backgroundColor":"#222222","text":"Btn enc:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false},{"name":"label1","type":"label","layer":3,"screenId":"builtin","screenName":"","id":"cT^ojsQ+_c0=KhbV","createTime":1722824992196,"x":0,"y":129,"color":"#ffffff","backgroundColor":"#222222","text":"Btn A:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false},{"name":"label2","type":"label","layer":4,"screenId":"builtin","screenName":"","id":"y=G*m`&hXtA+37S!","createTime":1722824999348,"x":0,"y":176,"color":"#ffffff","backgroundColor":"#222222","text":"Btn B:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false},{"name":"label3","type":"label","layer":6,"screenId":"builtin","screenName":"","id":"wF1oE5pQjSBv-M!=","createTime":1722825034891,"x":0,"y":37,"color":"#ffffff","backgroundColor":"#222222","text":"Rotary:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false},{"name":"label4","type":"label","layer":6,"screenId":"builtin","screenName":"","id":"yw`a2VIKc*pNp-aI","createTime":1722825093033,"x":173,"y":106,"color":"#ffffff","backgroundColor":"#222222","text":"LED A:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false},{"name":"label5","type":"label","layer":7,"screenId":"builtin","screenName":"","id":"gAY0FmbYTtL6-nDO","createTime":1722825135956,"x":173,"y":164,"color":"#ffffff","backgroundColor":"#222222","text":"LED B:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false},{"name":"label6","type":"label","layer":8,"screenId":"builtin","screenName":"","id":"gA+45INUXpy91CFQ","createTime":1722825166720,"x":173,"y":41,"color":"#ffffff","backgroundColor":"#222222","text":"Rotary Inc:","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"isSelected":false}],"resources":[{"hardware":["hardware_button","hardware_pin_button","imu","speaker","touch","mic","i2c"]},{"module":["module_hmi"]}],"units":[],"hats":[],"bases":[],"i2cs":[{"id":"i2c0","portType":"A","userPort":[22,21],"freq":"100000","blockId":"uVbuK_(!IX6AeiPjU},("}],"blockly":"<variables><variable id=\"SW!;d)?5ML^E*%Z+NA:O\">led_a_state</variable><variable id=\"/DS@He*DUndRLw/z./}2\">led_b_state</variable><variable id=\"N#IM:zd(kHBfGC:fz|8A\">btn_a_state</variable><variable id=\"_(=D_1TXh50f@32~}3vX\">btn_b_state</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"-110\" y=\"-269\"><mutation isBegin=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_begin\" id=\"system_m5_begin\"><next><block type=\"module_hmi_init\" id=\"PzPRXT)`SMP6S9fokRFT\"><field name=\"NAME\">hmi_0</field><value name=\"ADDR\"><shadow type=\"math_number\" id=\"?F/Ggw-!s,.],,{n+OhA\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0x41</field></shadow></value><next><block type=\"module_hmi_set_encoder_value\" id=\"GtdT47^JAA8P!o$H[P,N\"><field name=\"NAME\">hmi_0</field><value name=\"VALUE\"><shadow type=\"math_number\" id=\"^RUk@T*(~`N~V$=PscGN\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0</field></shadow></value></block></next></block></next></block></statement></block><block type=\"basic_on_loop\" id=\"loop_block\" deletable=\"false\" x=\"-110\" y=\"-70\"><mutation isUpdate=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_update\" id=\"system_m5_update\"><next><block type=\"variables_set\" id=\"r~S()L-2YtgweY-Ek;5v\"><field name=\"VAR\" id=\"SW!;d)?5ML^E*%Z+NA:O\">led_a_state</field><value name=\"VALUE\"><block type=\"module_hmi_get_led_state\" id=\"ofH%P1YHK@c0-`fF-4L8\"><field name=\"NAME\">hmi_0</field><value name=\"LED\"><shadow type=\"module_hmi_led_option\" id=\"`#pLQ2aWUx35EY;Vew?(\"><field name=\"VALUE\">1</field></shadow></value></block></value><next><block type=\"variables_set\" id=\"CR%`D_=DB8n_W)x][ySH\"><field name=\"VAR\" id=\"/DS@He*DUndRLw/z./}2\">led_b_state</field><value name=\"VALUE\"><block type=\"module_hmi_get_led_state\" id=\"k_WEQPM3i3lYiVb+Ku`6\"><field name=\"NAME\">hmi_0</field><value name=\"LED\"><shadow type=\"module_hmi_led_option\" id=\"!Q6g[nuDrIduW#OTsNEy\"><field name=\"VALUE\">2</field></shadow></value></block></value><next><block type=\"variables_set\" id=\"NS.6Zce+?uIVAsoU3jC`\"><field name=\"VAR\" id=\"N#IM:zd(kHBfGC:fz|8A\">btn_a_state</field><value name=\"VALUE\"><block type=\"module_hmi_get_button_state\" id=\"WCs@5*5]s,gy`3^TpD|a\"><field name=\"NAME\">hmi_0</field><field name=\"OPTION\">2</field></block></value><next><block type=\"variables_set\" id=\"V*_v{MB)33d0;(4Fv`)F\"><field name=\"VAR\" id=\"_(=D_1TXh50f@32~}3vX\">btn_b_state</field><value name=\"VALUE\"><block type=\"module_hmi_get_button_state\" id=\"4yZz0|XiX@u25:14}|4g\"><field name=\"NAME\">hmi_0</field><field name=\"OPTION\">3</field></block></value><next><block type=\"label_set_text\" id=\"%N0HrPuq{JSTr.o-amDh\"><field name=\"NAME\">label0</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Ns8_)dH%+3h^D{i+.2L+\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"W3_%62t5UlD!u88hGg{9\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"rYO%/q0kpsyh$cUj,]qf\"><field name=\"TEXT\">Rotary:</field></shadow></value><value name=\"VALUE2\"><block type=\"module_hmi_get_button_state\" id=\"Ka.cYPEv}4KT:V1gdEX^\"><field name=\"NAME\">hmi_0</field><field name=\"OPTION\">1</field></block></value></block></value><next><block type=\"label_set_text\" id=\"QCP]Xf2KVs-/hKH3Tx@T\"><field name=\"NAME\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Ns8_)dH%+3h^D{i+.2L+\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"Hq`O=#EfcNil=wxI4nk|\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"NZxeTzhO11~4G=#{Q@(1\"><field name=\"TEXT\">Btn A:</field></shadow></value><value name=\"VALUE2\"><block type=\"variables_get\" id=\"=#|/7i[*]y%]eX=aV[B2\"><field name=\"VAR\" id=\"N#IM:zd(kHBfGC:fz|8A\">btn_a_state</field></block></value></block></value><next><block type=\"label_set_text\" id=\"t#BXsEBZ!Q^]}PR(oAqZ\"><field name=\"NAME\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Ns8_)dH%+3h^D{i+.2L+\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"{=f;]NtV:fWbV??F*hLN\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"(.3atg:xjV;6O@])2NA:\"><field name=\"TEXT\">Btn B:</field></shadow></value><value name=\"VALUE2\"><block type=\"variables_get\" id=\"9,6P.vP?3$@%OG^%{61Y\"><field name=\"VAR\" id=\"_(=D_1TXh50f@32~}3vX\">btn_b_state</field></block></value></block></value><next><block type=\"label_set_text\" id=\"2t=`1^F#$:]^.DC-#;hC\"><field name=\"NAME\">label4</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Ns8_)dH%+3h^D{i+.2L+\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"1[0JeKUe6r)TDL+!R6|k\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"Z..YMDkHxwob?kqhYlSB\"><field name=\"TEXT\">LED A:</field></shadow></value><value name=\"VALUE2\"><block type=\"variables_get\" id=\"O4*8-{q!ut{$yuRZVhvY\"><field name=\"VAR\" id=\"SW!;d)?5ML^E*%Z+NA:O\">led_a_state</field></block></value></block></value><next><block type=\"label_set_text\" id=\"N])s}=?:vb,TJy:,d:lc\"><field name=\"NAME\">label5</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Jc#,9gL_GFlyExjt5db;\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"SUf_2KBfGl$Z`Nh,COJl\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"J88TM:F(:uQhq4d(N#:[\"><field name=\"TEXT\">LED B:</field></shadow></value><value name=\"VALUE2\"><block type=\"variables_get\" id=\"4Y4;G+[R0SFh6|h=i)l%\"><field name=\"VAR\" id=\"/DS@He*DUndRLw/z./}2\">led_b_state</field></block></value></block></value><next><block type=\"label_set_text\" id=\"_p+nkP:pb-n?!nq{+r%`\"><field name=\"NAME\">label3</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Jc#,9gL_GFlyExjt5db;\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"G;;~.F1Ga?JImLldx.?g\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"]uB2Q~uRwmdy,(v59WTM\"><field name=\"TEXT\">Enc:</field></shadow></value><value name=\"VALUE2\"><block type=\"module_hmi_get_encoder_value\" id=\"zRs]VF)R~M@byIG8q*/)\"><field name=\"NAME\">hmi_0</field></block></value></block></value><next><block type=\"controls_if\" id=\"RcE7lj,[vA~0/}mUTO)}\"><mutation elseif=\"2\"></mutation><value name=\"IF0\"><block type=\"module_hmi_get_button_state\" id=\"a+@91{GOn5$__BB8_$h$\"><field name=\"NAME\">hmi_0</field><field name=\"OPTION\">1</field></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\"/f_oBN.Ugjjc9PZ?N!a!\"><field name=\"NAME\">label6</field><value name=\"TEXT\"><shadow type=\"text\" id=\"Jc#,9gL_GFlyExjt5db;\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"q`k_rbgm4(ORjjGiN34`\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"sN!/=qJS_0qrwo#ILk,I\"><field name=\"TEXT\">Rotary Inc:</field></shadow></value><value name=\"VALUE2\"><block type=\"module_hmi_get_increment_value\" id=\":4Cq1am]TN8zx{9K3A|`\"><field name=\"NAME\">hmi_0</field></block></value></block></value></block></statement><value name=\"IF1\"><block type=\"variables_get\" id=\"i](I+h+f*cAp6X1Mhv3l\"><field name=\"VAR\" id=\"N#IM:zd(kHBfGC:fz|8A\">btn_a_state</field></block></value><statement name=\"DO1\"><block type=\"variables_set\" id=\"kcttClx2tl)EIM!ZKQ2Q\"><field name=\"VAR\" id=\"SW!;d)?5ML^E*%Z+NA:O\">led_a_state</field><value name=\"VALUE\"><block type=\"logic_negate\" id=\"M$,W-VTw8jngrhhcalGY\"><value name=\"BOOL\"><block type=\"variables_get\" id=\"3=_1keC4=Z6l3Hy-RPpy\"><field name=\"VAR\" id=\"SW!;d)?5ML^E*%Z+NA:O\">led_a_state</field></block></value></block></value><next><block type=\"module_hmi_set_led_state\" id=\"f3EUU*26pxBC|31,ChoM\"><field name=\"NAME\">hmi_0</field><value name=\"LED\"><shadow type=\"module_hmi_led_option\" id=\"|!/~}n,Bo4Zwo-D9l[IC\"><field name=\"VALUE\">1</field></shadow></value><value name=\"STATE\"><shadow type=\"module_hmi_state_option\" id=\"KC9}(KoNuDi6)0}{7By[\"><field name=\"VALUE\">0</field></shadow><block type=\"variables_get\" id=\"Q}7qUk|2E^=RDQ(O_(v4\"><field name=\"VAR\" id=\"SW!;d)?5ML^E*%Z+NA:O\">led_a_state</field></block></value></block></next></block></statement><value name=\"IF2\"><block type=\"variables_get\" id=\"$kV}ITnuP/YW*02vW=$F\"><field name=\"VAR\" id=\"_(=D_1TXh50f@32~}3vX\">btn_b_state</field></block></value><statement name=\"DO2\"><block type=\"variables_set\" id=\"){wB(]c42I%qC[Y/LR]B\"><field name=\"VAR\" id=\"/DS@He*DUndRLw/z./}2\">led_b_state</field><value name=\"VALUE\"><block type=\"logic_negate\" id=\"]N3{P~(2#b-%]OOEzo!g\"><value name=\"BOOL\"><block type=\"variables_get\" id=\"SkeE]k|v[gl4na[;Cc(_\"><field name=\"VAR\" id=\"/DS@He*DUndRLw/z./}2\">led_b_state</field></block></value></block></value><next><block type=\"module_hmi_set_led_state\" id=\"E@BBW$|Y}m%}K[o2VF.e\"><field name=\"NAME\">hmi_0</field><value name=\"LED\"><shadow type=\"module_hmi_led_option\" id=\"Cu}TwGuPy^v1wXd(F9CO\"><field name=\"VALUE\">2</field></shadow></value><value name=\"STATE\"><shadow type=\"module_hmi_state_option\" id=\"KC9}(KoNuDi6)0}{7By[\"><field name=\"VALUE\">0</field></shadow><block type=\"variables_get\" id=\"UJ8pi]1Prm}1Fe.2~nw8\"><field name=\"VAR\" id=\"/DS@He*DUndRLw/z./}2\">led_b_state</field></block></value><next><block type=\"module_hmi_reset_encoder_value\" id=\"Tda|DTln#ws]p4hITq_v\"><field name=\"NAME\">hmi_0</field></block></next></block></next></block></statement><next><block type=\"time_sleep_millisecond\" id=\"-Y6]9zndw,`3}L@/42d@\"><value name=\"MS\"><shadow type=\"math_number\" id=\"S(l]L3joerQX`gOgxg;.\"><mutation max=\"Infinity\" min=\"0\" precision=\"0\"></mutation><field name=\"NUM\">200</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block>","screen":[{"simulationName":"Built-in","type":"builtin","width":320,"height":240,"scale":0.78,"screenName":"","blockId":"","screenColorType":0,"id":"builtin","createTime":1722824950441}],"logicWhenNum":0,"customList":[]}

0 commit comments

Comments
 (0)