Files
mixly3/boards/default/micropython_esp32c2/examples/MixGo MINI/外设使用示例/01-按钮切换灯-双轻触按键.mix
2025-01-24 15:22:04 +08:00

1 line
4.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<xml version="Mixly 3.0 rc0" board="Python ESP32-C2@MixGo MINI" shown="block"><comment id="DJ2OZMts}V=26Y04]CzX" x="-1960" y="-379" w="166.811767578125" h="100">双轻触按键连接到U2使用IO3、IO4</comment><block type="inout_digital_init" id="86]M(wK;@+I1g(Te=Y+Y" x="-1745" y="-411"><field name="PIN_OBJ">pin3</field><field name="MODE">machine.Pin.IN</field><value name="PIN"><shadow type="pins_digital_pin" id="wolwX(9,F7k7YS(WiHWU"><field name="PIN">3</field></shadow></value><next><block type="inout_digital_init" id="y51mDjo~1|RV,t``4.gc"><field name="PIN_OBJ">pin4</field><field name="MODE">machine.Pin.IN</field><value name="PIN"><shadow type="pins_digital_pin" id="rO,_z!$KwDfR-g/!g8p7"><field name="PIN">4</field></shadow></value><next><block type="controls_whileUntil" id="!/ft,anB9szWRW[Iu9mQ"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="|V=:~kPLk}0VLX:|*7ZJ"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="{|+o}6`Mjd6FZz|Y~f?i"><value name="IF0"><block type="inout_digital_read" id="@B#FvQy!KYM20H]Gy6,-"><value name="PIN"><shadow type="pins_digital" id="qvXq[h`UZLW)|Wq-B7+G"><field name="PIN">pin3</field></shadow></value></block></value><statement name="DO0"><block type="do_while" id="_i6)*6Pk]Q|ZZo$QKPZ*"><field name="type">true</field><statement name="input_data"><block type="controls_delay_new" id="z0tV2P44@$EuW{XaKU!`"><field name="Time">ms</field><value name="DELAY_TIME"><shadow type="math_number" id="}Wf]jk$/js;M`h0~=rG5"><field name="NUM">1</field></shadow></value></block></statement><value name="select_data"><block type="logic_negate" id="Gwh21$#iRvHF;h@GJ2I2"><value name="BOOL"><block type="inout_digital_read" id="ZdfilJ|bFKsB(Y.R|/yt"><value name="PIN"><shadow type="pins_digital" id="NfaL0FqhV#o9PG2)ZS=}"><field name="PIN">pin3</field></shadow></value></block></value></block></value><next><block type="actuator_led_bright" id="kP*7|OL}2{VB`YqQ#1gu"><value name="led"><shadow type="number" id="X-a;H`v$C*rwx5yMCIr0"><field name="op">1</field></shadow></value><value name="bright"><shadow type="ledswitch" id="B]jO~I9VGld`Q-fxVGd9"><field name="flag">-1</field></shadow></value></block></next></block></statement><next><block type="controls_if" id="Amm@laUw#,!SBtY5Em0x"><value name="IF0"><block type="inout_digital_read" id="zC:jjCa-;a093{aUihkn"><value name="PIN"><shadow type="pins_digital" id="iLzjvIY`P}Dl!89k1evC"><field name="PIN">pin4</field></shadow></value></block></value><statement name="DO0"><block type="do_while" id="cOU5vE{9.HA]=u`7e:v;"><field name="type">true</field><statement name="input_data"><block type="controls_delay_new" id="m/dDQ,!^^en~pwbJHDT9"><field name="Time">ms</field><value name="DELAY_TIME"><shadow type="math_number" id="s5Vj`W_a.W8:+e-*~`#f"><field name="NUM">1</field></shadow></value></block></statement><value name="select_data"><block type="logic_negate" id="=Hyox#Wm=PD-`JU0lM(~"><value name="BOOL"><block type="inout_digital_read" id="{J.6nPf,{lJ#l8TEr+!Q"><value name="PIN"><shadow type="pins_digital" id="DZ-d+_`iDh/lo`WfiU-Q"><field name="PIN">pin4</field></shadow></value></block></value></block></value><next><block type="actuator_led_bright" id="i/wNMk)L-yc]O7x|{^E1"><value name="led"><shadow type="number" id="gJ$7du#Ev~h-7W^[iNG*"><field name="op">2</field></shadow></value><value name="bright"><shadow type="ledswitch" id="J9#G0P*54WLT-shTx4~v"><field name="flag">-1</field></shadow></value></block></next></block></statement></block></next></block></statement></block></next></block></next></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IHRpbWUKZnJvbSBtaXhnb19taW5pIGltcG9ydCBvbmJvYXJkX2xlZAoKCnBpbjMgPSBtYWNoaW5lLlBpbigzLCBtYWNoaW5lLlBpbi5JTikKcGluNCA9IG1hY2hpbmUuUGluKDQsIG1hY2hpbmUuUGluLklOKQp3aGlsZSBUcnVlOgogICAgaWYgcGluMy52YWx1ZSgpOgogICAgICAgIHdoaWxlIFRydWU6CiAgICAgICAgICAgIHRpbWUuc2xlZXBfbXMoMSkKICAgICAgICAgICAgaWYgKG5vdCBwaW4zLnZhbHVlKCkpOgogICAgICAgICAgICAgICAgYnJlYWsKICAgICAgICBvbmJvYXJkX2xlZC5zZXRvbm9mZigxLC0xKQogICAgaWYgcGluNC52YWx1ZSgpOgogICAgICAgIHdoaWxlIFRydWU6CiAgICAgICAgICAgIHRpbWUuc2xlZXBfbXMoMSkKICAgICAgICAgICAgaWYgKG5vdCBwaW40LnZhbHVlKCkpOgogICAgICAgICAgICAgICAgYnJlYWsKICAgICAgICBvbmJvYXJkX2xlZC5zZXRvbm9mZigyLC0xKQo=</code>