Files
mixly3/boards/default/micropython_esp32/examples/mPython/23-1-蓝牙通讯-从机模式.mix
王立帮 f4bcc9166c Revert "update examples"
This reverts commit af3e64a06d.
2025-03-09 10:50:41 +08:00

1 line
4.3 KiB
XML

<xml version="Mixly 2.0 rc4" board="Python ESP32@mPython"><variables><variable id="d$Hz)_vvA0^=g9`rK.n2">data</variable></variables><block type="communicate_bluetooth_peripheral_init" id="^+}u[-A1+pbP1)w1#/DY" x="-1213" y="-853"><value name="VAR"><shadow type="variables_get" id="T`A/-u208(3ORWY=_T#1"><field name="VAR">ble_x</field></shadow></value><value name="data"><shadow type="text" id="#~VJthpws=AWG;v}9=`P"><field name="TEXT">Mixly_Slave</field></shadow></value><next><block type="communicate_bluetooth_recv" id="HMF!U5C6|C+*SM~BF_UD"><value name="VAR"><shadow type="variables_get" id="TqxkVX`{3.dM,wcdL$[K"><field name="VAR">ble_x</field></shadow></value><value name="METHOD"><shadow type="factory_block_return" id="*Ik,@/Uv!fy-GuV_9g5h"><field name="VALUE">ble_method</field></shadow></value><next><block type="controls_whileUntil" id="3E#0Gui6U$#US?ZGah}B"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="@6Neenn5P3T3|i=)9SKi"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="`O?CRLH(KwSWwhHj}*Vb"><mutation else="1"></mutation><value name="IF0"><block type="communicate_bluetooth_is_connected" id="gZ?G]2m8!NzN/SSb)Mt}"><value name="VAR"><shadow type="variables_get" id="aML=shGZq|@6,b3nBh:Q"><field name="VAR">ble_x</field></shadow></value></block></value><statement name="DO0"><block type="onboard_oled_show_string" id="SJFn1xFqY,,0n,ktYq4+"><value name="data"><shadow type="text" id="`JKLQoqcW2o[M=`qN@.@"><field name="TEXT">OK</field></shadow></value><next><block type="controls_if" id="PAHUm.Kw?D~Uszx50DQ]"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="A8][UApx;vw,~M5V-LTy"><value name="btn"><shadow type="pins_button" id="WRYlp{4vE[drSFhgUsA/"><field name="PIN">button_a</field></shadow></value></block></value><statement name="DO0"><block type="communicate_bluetooth_send" id="?bAV;-O5mwZBc[pC$~qJ"><value name="VAR"><shadow type="variables_get" id="l}DWHwI79)RdVk^SILI7"><field name="VAR">ble_x</field></shadow></value><value name="data"><shadow type="text" id="ikLn-7=uuo[.Sq!L~Fr|"><field name="TEXT">A按键按下</field></shadow></value></block></statement><next><block type="controls_if" id="J3qz`UD?^VyaI(C.;pD."><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="}Iu2v4r[VgNr/e@2h7C|"><value name="btn"><shadow type="pins_button" id="6}u}o^#]Ifns[+YJyf[m"><field name="PIN">button_b</field></shadow></value></block></value><statement name="DO0"><block type="communicate_bluetooth_send" id="O0;PHMM0R;wJhL^28dD9"><value name="VAR"><shadow type="variables_get" id="Rg]ax7AWm$Sr(M?Y!#B*"><field name="VAR">ble_x</field></shadow></value><value name="data"><shadow type="text" id="96}6:vAVs[~prN7Xo*sI"><field name="TEXT">B按键按下</field></shadow></value></block></statement></block></next></block></next></block></statement><statement name="ELSE"><block type="onboard_oled_show_string" id="S]Rz4{RwE!!1PwnD:2t2"><value name="data"><shadow type="text" id="-.~-v#=SN@AfgnF6D;-["><field name="TEXT">==</field></shadow></value></block></statement></block></statement></block></next></block></next></block><block type="procedures_defnoreturn" id="?:;We=Q?G!hfX5`.7ZZ+" x="-1208" y="-319"><mutation><arg name="data" varid="d$Hz)_vvA0^=g9`rK.n2"></arg></mutation><field name="NAME">ble_method</field><statement name="STACK"><block type="system_print" id="/naAs-:*LX4W,#M@z,f8"><value name="VAR"><shadow type="text" id="Azx(3xlMy)AhEA|Q.}9]"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="*oD,d0M85NAK;|b)Z1ev"><field name="VAR">data</field></block></value></block></statement></block></xml><config>{}</config><code>aW1wb3J0IGJsZV9wZXJpcGhlcmFsCmZyb20gbXB5dGhvbiBpbXBvcnQgb25ib2FyZF9vbGVkCmltcG9ydCBtcHl0aG9uCmltcG9ydCBtYWNoaW5lCgpkZWYgYmxlX21ldGhvZChkYXRhKToKICAgIHByaW50KGRhdGEpCgoKCmJsZV94ID0gYmxlX3BlcmlwaGVyYWwuQkxFU2ltcGxlUGVyaXBoZXJhbCgnTWl4bHlfU2xhdmUnKQpibGVfeC5yZWN2KGJsZV9tZXRob2QpCndoaWxlIFRydWU6CiAgICBpZiBibGVfeC5pc19jb25uZWN0ZWQoKToKICAgICAgICBvbmJvYXJkX29sZWQuc2hvd3MoJ09LJykKICAgICAgICBpZiBtcHl0aG9uLmJ1dHRvbl9hLndhc19wcmVzc2VkKCk6CiAgICAgICAgICAgIGJsZV94LnNlbmQoJ0HmjInplK7mjInkuIsnKQogICAgICAgIGlmIG1weXRob24uYnV0dG9uX2Iud2FzX3ByZXNzZWQoKToKICAgICAgICAgICAgYmxlX3guc2VuZCgnQuaMiemUruaMieS4iycpCiAgICBlbHNlOgogICAgICAgIG9uYm9hcmRfb2xlZC5zaG93cygnPT0nKQo=</code>