Files
mixly3-server/mixly/boards/default/micropython_esp32s3/examples/MixGo Nova/23-1-蓝牙通讯-主机模式.mix

1 line
6.0 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-S3@元控青春NOVA" shown="block"><variables><variable id="*5WT[`,Lbe5En3jd}uUk">data</variable></variables><block type="communicate_bluetooth_central_init" id="CSYy]ctn3FSB/~3@D[Ju" x="-871" y="-463"><value name="VAR"><shadow type="variables_get" id="#[WJ842w3]qX.Cvc{@Pq"><field name="VAR">ble_c</field></shadow></value><next><block type="communicate_bluetooth_recv" id="xs-)e3~b4[OHFvW8R4]!"><value name="VAR"><shadow type="variables_get" id="gW#M-+wKNk+T43XrjtAL"><field name="VAR">ble_c</field></shadow></value><value name="METHOD"><shadow type="factory_block_return" id="4lSwR.z_7hn7=vETMQQ@"><field name="VALUE">ble_method</field></shadow></value><next><block type="controls_whileUntil" id="F.(5M|N,VZZ_LdYpYK0o"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="Uu,{*`~B2j5|A!`#mGYt"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="bp{Q~hBCwtq=oh|v;)Y;"><mutation else="1"></mutation><value name="IF0"><block type="communicate_bluetooth_is_connected" id="uq+A`*O{wC6[K):uL[5G"><value name="VAR"><shadow type="variables_get" id="iL,WO_gVsmmRbnS9CEXz"><field name="VAR">ble_c</field></shadow></value></block></value><statement name="DO0"><block type="actuator_onboard_neopixel_rgb_all" id=")L486V*,1#t=*65dZuB~"><value name="RVALUE"><shadow type="math_number" id="~),C!C!d5k7-9c/ThGpz"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="_wXwvRxoXn{nDsf,c8@^"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="FRb/.P7t4/2/M1O^O]9E"><field name="NUM">10</field></shadow></value><next><block type="controls_if" id="]fJ64d0:8Y4F:vX]2^gv"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="xq`/m91d_}Nvd$8gS~57"><value name="btn"><shadow type="pins_button" id="2,M:7i+,HO;Tfn8n[g!,"><field name="PIN">B1key</field></shadow></value></block></value><statement name="DO0"><block type="communicate_bluetooth_send" id="/zd`xT8;GA[_#|IWGlaE"><value name="VAR"><shadow type="variables_get" id="t|H|u;RX0{0}:Gt+yA5e"><field name="VAR">ble_c</field></shadow></value><value name="data"><shadow type="text" id="Ld?hCL1MYbA8He2JIR2g"><field name="TEXT">数据</field></shadow><block type="number_to_text" id="|VZxGVMP]-uq^^{Ao]b)"><value name="VAR"><shadow type="variables_get" id=";mVk7FqF`ggoq$XE?yX{"><field name="VAR">x</field></shadow><block type="math_random" id="B4XqHnPQp.^CP0-SQhC6"><field name="TYPE">int</field><value name="FROM"><shadow type="math_number" id="JCTt$[E7Px4[0^O6oV?t"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number" id="5}vNmA=D}|chGeB@`UCI"><field name="NUM">100</field></shadow></value></block></value></block></value></block></statement></block></next></block></statement><statement name="ELSE"><block type="actuator_onboard_neopixel_rgb_all" id="p-g+q=L4EfA+:c=n4Mp*"><value name="RVALUE"><shadow type="math_number" id="Q;J7dZ;Vj@kF{sO.{,t?"><field name="NUM">0</field></shadow></value><value name="GVALUE"><shadow type="math_number" id="{4A*)P=#{_Vq0U{Q4,u2"><field name="NUM">0</field></shadow></value><value name="BVALUE"><shadow type="math_number" id="=Dx3r4]hk+7PeA$o@cbd"><field name="NUM">0</field></shadow></value><next><block type="controls_try_finally" id="!sRao?]-g,Ft9ORJr)rd"><mutation elseif="1"></mutation><statement name="try"><block type="communicate_bluetooth_connect" id="_/;;joUPd3E=YfY;v;;S"><field name="mode">name</field><value name="VAR"><shadow type="variables_get" id="dE[M}*v;,rgY?rvHB^SR"><field name="VAR">ble_c</field></shadow></value><value name="data"><shadow type="text" id="0/Tb^^s2bI)JZc3.gSNQ"><field name="TEXT">Mixly_Slave</field></shadow></value></block></statement><value name="IF1"><shadow type="factory_block_return" id="qEE;$fA!/GGrNX{amWmd"><field name="VALUE">Exception as e</field></shadow></value></block></next></block></statement><next><block type="actuator_onboard_neopixel_write" id="Vwghc?RoCEjH,+gU[jl!"></block></next></block></statement></block></next></block></next></block><block type="procedures_defnoreturn" id="E?i?L$@k,,#0;+nyFvPx" x="-874" y="115"><mutation><arg name="data" varid="*5WT[`,Lbe5En3jd}uUk"></arg></mutation><field name="NAME">ble_method</field><statement name="STACK"><block type="system_print" id="=sjalV{OREKDsXnK$q.r"><value name="VAR"><shadow type="text" id="qNjW!Lh2F[9KX0^YxRyI"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="P!=a+-d*hLnOoXhvsX{M"><field name="VAR">data</field></block></value><next><block type="display_show_image_or_string_delay" id="|W2h)C!bG.H++Ls49]Ys"><field name="center">True</field><value name="data"><shadow type="text" id="rudyw-.`F.k.91{VEC9L"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="Z9jGsU5qNjbP^?vX*+#b"><field name="VAR">data</field></block></value><value name="space"><shadow type="math_number" id="ia-JU5-v7#12Ml[x)/R-"><field name="NUM">0</field></shadow></value><value name="boolean"><shadow type="logic_boolean" id="xY;d{1`[yAH85@KYD7_,"><field name="BOOL">TRUE</field></shadow></value></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IGJsZV9jZW50cmFsCmZyb20gbWl4Z29fbm92YSBpbXBvcnQgb25ib2FyZF9yZ2IKaW1wb3J0IG1peGdvX25vdmEKaW1wb3J0IHJhbmRvbQppbXBvcnQgbWFjaGluZQpmcm9tIG1peGdvX25vdmEgaW1wb3J0IG9uYm9hcmRfdGZ0CgpkZWYgYmxlX21ldGhvZChkYXRhKToKICAgIHByaW50KGRhdGEpCiAgICBvbmJvYXJkX3RmdC5zaG93cyhkYXRhLCBzcGFjZT0wLCBjZW50ZXI9VHJ1ZSxzeW5jPVRydWUpCgoKYmxlX2MgPSBibGVfY2VudHJhbC5CTEVTaW1wbGVDZW50cmFsKCkKYmxlX2MucmVjdihibGVfbWV0aG9kKQp3aGlsZSBUcnVlOgogICAgaWYgYmxlX2MuaXNfY29ubmVjdGVkKCk6CiAgICAgICAgb25ib2FyZF9yZ2IuZmlsbCgoMCwgMCwgMTApKQogICAgICAgIGlmIG1peGdvX25vdmEuQjFrZXkud2FzX3ByZXNzZWQoKToKICAgICAgICAgICAgYmxlX2Muc2VuZChzdHIoKHJhbmRvbS5yYW5kaW50KDEsIDEwMCkpKSkKICAgIGVsc2U6CiAgICAgICAgb25ib2FyZF9yZ2IuZmlsbCgoMCwgMCwgMCkpCiAgICAgICAgdHJ5OgogICAgICAgICAgICBibGVfYy5jb25uZWN0KG5hbWU9J01peGx5X1NsYXZlJykKICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHBhc3MKICAgIG9uYm9hcmRfcmdiLndyaXRlKCkK</code>