Files
mixly3/sample/Python ESP32/mPython/23-1-蓝牙通讯-主机模式.mix
2024-07-19 10:16:00 +08:00

1 line
4.1 KiB
XML

<xml version="Mixly 2.0 rc4" board="Python ESP32@mPython"><variables><variable id="*5WT[`,Lbe5En3jd}uUk">data</variable></variables><block type="communicate_bluetooth_central_init" id="NKl@Oo^Ij8ys`J:_qP~y" x="-871" y="-463"><value name="VAR"><shadow type="variables_get" id=":c3Vs#J[9M?!jsm8_hpr"><field name="VAR">ble_c</field></shadow></value><next><block type="communicate_bluetooth_recv" id=",!!s9JVnA,RWtc$TeKc*"><value name="VAR"><shadow type="variables_get" id="Q^^3Dgryo7o+ADpj[YOW"><field name="VAR">ble_c</field></shadow></value><value name="METHOD"><shadow type="factory_block_return" id="j:|sYHS7UW680^lh5Bvk"><field name="VALUE">ble_method</field></shadow></value><next><block type="controls_whileUntil" id="SUVfDV~YU?Su-a1g+MH`"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="c5iyNa:?$8T[mZ7?ihH8"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="4Wahim4fRK]lraym@/)/"><mutation else="1"></mutation><value name="IF0"><block type="communicate_bluetooth_is_connected" id="0XOIR.G.n:6kqAZCDZti"><value name="VAR"><shadow type="variables_get" id="x;k#USmhB]aq)IZ7ZJ6("><field name="VAR">ble_c</field></shadow></value></block></value><statement name="DO0"><block type="controls_if" id=";zF8OtfqYX/etI*9jovn"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="V:{xhMJYI.*-#DI56i1:"><value name="btn"><shadow type="pins_button" id="fUF]/|SOH^0VI+o=FYV?"><field name="PIN">button_a</field></shadow></value></block></value><statement name="DO0"><block type="communicate_bluetooth_send" id="H`vtA=FHB9x#egN;-sjf"><value name="VAR"><shadow type="variables_get" id="nIW.UWrj4Rys(41U!spo"><field name="VAR">ble_c</field></shadow></value><value name="data"><shadow type="text" id="d9AzF7iC.pWicgCGKeZL"><field name="TEXT">test</field></shadow></value></block></statement><next><block type="onboard_oled_show_string" id="+6Z3)v{!ea{K|ux_Z.IZ"><value name="data"><shadow type="text" id="?.MuBG-]-KMuvP:KcP47"><field name="TEXT">OK</field></shadow></value></block></next></block></statement><statement name="ELSE"><block type="onboard_oled_show_string" id="s9m}Du;riML=1aKUFQNl"><value name="data"><shadow type="text" id="WVc0c,86*.zP5.O}$JKR"><field name="TEXT">==</field></shadow></value><next><block type="controls_try_finally" id="E,*EmmPGzbz/y#I4aZ/l"><mutation elseif="1"></mutation><statement name="try"><block type="communicate_bluetooth_connect" id="y+MGSj6`_,|fL,u;1_O0"><field name="mode">name</field><value name="VAR"><shadow type="variables_get" id="e8nnWv,m(@~Dt(_2hjb-"><field name="VAR">ble_c</field></shadow></value><value name="data"><shadow type="text" id=",2Irc(i=#GBC#;3W/_v`"><field name="TEXT">Mixly_Slave</field></shadow></value></block></statement><value name="IF1"><shadow type="factory_block_return" id="zo2M*o$#pCd*MxElBv$_"><field name="VALUE">Exception as e</field></shadow></value></block></next></block></statement></block></statement></block></next></block></next></block><block type="procedures_defnoreturn" id="q;hLDVlC3hs#d91.(T||" x="-860" y="72"><mutation><arg name="data" varid="*5WT[`,Lbe5En3jd}uUk"></arg></mutation><field name="NAME">ble_method</field><statement name="STACK"><block type="system_print" id="_+u2ETv9+py*.Z_Xa`^h"><value name="VAR"><shadow type="text" id="vvK@4It.zN4DiDRsC:H@"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="#prr(wM0_|2QN4Wz;Gk}"><field name="VAR">data</field></block></value></block></statement></block></xml><config>{}</config><code>aW1wb3J0IGJsZV9jZW50cmFsCmltcG9ydCBtcHl0aG9uCmZyb20gbXB5dGhvbiBpbXBvcnQgb25ib2FyZF9vbGVkCmltcG9ydCBtYWNoaW5lCgpkZWYgYmxlX21ldGhvZChkYXRhKToKICAgIHByaW50KGRhdGEpCgoKCmJsZV9jID0gYmxlX2NlbnRyYWwuQkxFU2ltcGxlQ2VudHJhbCgpCmJsZV9jLnJlY3YoYmxlX21ldGhvZCkKd2hpbGUgVHJ1ZToKICAgIGlmIGJsZV9jLmlzX2Nvbm5lY3RlZCgpOgogICAgICAgIGlmIG1weXRob24uYnV0dG9uX2Eud2FzX3ByZXNzZWQoKToKICAgICAgICAgICAgYmxlX2Muc2VuZCgndGVzdCcpCiAgICAgICAgb25ib2FyZF9vbGVkLnNob3dzKCdPSycpCiAgICBlbHNlOgogICAgICAgIG9uYm9hcmRfb2xlZC5zaG93cygnPT0nKQogICAgICAgIHRyeToKICAgICAgICAgICAgYmxlX2MuY29ubmVjdChuYW1lPSdNaXhseV9TbGF2ZScpCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBwYXNzCg==</code>