Files
mixly3/boards/default/micropython_esp32/examples/mPython/18-2-复杂控制-循环计时.mix
王立帮 f4bcc9166c Revert "update examples"
This reverts commit af3e64a06d.
2025-03-09 10:50:41 +08:00

1 line
5.5 KiB
XML

<xml version="Mixly 2.0 rc4" board="Python ESP32@mPython"><variables><variable id="ok:ro0iEW(eJAtg/iAsj">tim</variable></variables><block type="variables_set" id="*yHK;-zyZ9No$7k4f+7~" x="-3000" y="-1011"><field name="VAR">开始</field><value name="VALUE"><block type="logic_boolean" id="!G|~iCk35Qj+7sH$r=rp"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="D0;Ezh(Th/UO-#EWFEk^"><field name="VAR">计时</field><value name="VALUE"><block type="math_number" id="eRG0z.DJdt!J2*4K(`l-"><field name="NUM">0</field></block></value><next><block type="system_timer_init" id="M?q/n@z(PQvI(#ny:1L."><value name="SUB"><shadow type="variables_get" id="Ek^Qm!1/JBp[7g9rjy]u"><field name="VAR">tim</field></shadow></value><next><block type="system_timer" id="IhndGIv2`*a1Pde@`igs"><field name="mode">PERIODIC</field><value name="VAR"><shadow type="variables_get" id="9L|RJ,p|xM:S:(gRnp{^"><field name="VAR">tim</field></shadow></value><value name="period"><shadow type="math_number" id="b;:sysFp*)I)Er|]]2$."><field name="NUM">100</field></shadow></value><value name="callback"><shadow type="factory_block_return" id="c=#=Bs{3}eHKdU=V}v+F"><field name="VALUE">tim_callback</field></shadow></value><next><block type="controls_whileUntil" id="?k.}Qw-vpl-t!8Vx^MFo"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="c,8:D6)FmMbgC^:FraDV"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="controls_if" id="agzy@vD+IB6t`^dOC7TZ"><value name="IF0"><block type="sensor_mixgo_button_was_pressed" id="Ia6uOXMNdt5gzqt1a*;w"><value name="btn"><shadow type="pins_button" id=";CE5J+rkaEjYFyOtbP|Q"><field name="PIN">button_a</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="#T0NLmA8YKXbCFTJfz3`"><field name="VAR">开始</field><value name="VALUE"><block type="logic_negate" id=".3hErshxV-q0}B.}3u5m"><value name="BOOL"><block type="variables_get" id="q7vI|TjVXK?C+u?:*Vfv"><field name="VAR">开始</field></block></value></block></value></block></statement><next><block type="controls_if" id="A^!L^Gp.|MRP{[-R2D3$"><value name="IF0"><block type="logic_operation" id="~|XAVOtC1knm|cQBU7RP"><field name="OP">AND</field><value name="A"><block type="sensor_mixgo_button_was_pressed" id="}T?h6Y;uw,,@2oU}qa{S"><value name="btn"><shadow type="pins_button" id="I{.rx`tUX(|44x@x~Hqm"><field name="PIN">button_a</field></shadow></value></block></value><value name="B"><block type="logic_negate" id="-oXE^PVO?aA*!v^l|ay."><value name="BOOL"><block type="variables_get" id="BC0Z,.V$5dU-o{Nht3Nz"><field name="VAR">开始</field></block></value></block></value></block></value><statement name="DO0"><block type="variables_set" id="uprscZtlt@y/{Tr,Qw`B"><field name="VAR">计时</field><value name="VALUE"><block type="math_number" id="u~Cjqrot:Pcn~RzEDF61"><field name="NUM">0</field></block></value></block></statement><next><block type="onboard_oled_show_string" id="8#F`#0MRntY~p_7HM56m"><value name="data"><shadow type="text" id="Fa4|svYM*s_z_9+S~45E"><field name="TEXT">Mixly</field></shadow><block type="number_to_text" id=")mn?umh!S33`y8nHJ#E$"><value name="VAR"><shadow type="variables_get" id="Yw^yVW}f)#v!zeyI^q(x"><field name="VAR">x</field></shadow><block type="variables_get" id="JC]kE{v8^h+Do[[~ZnDE"><field name="VAR">计时</field></block></value></block></value></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block><block type="procedures_defnoreturn" id="J*S4ki8!01*aN0#BORMu" x="-2972" y="-578"><mutation><arg name="tim" varid="ok:ro0iEW(eJAtg/iAsj"></arg></mutation><field name="NAME">tim_callback</field><statement name="STACK"><block type="variables_global" id="y#88_a7.k$J#n!,GaT[K"><value name="VAR"><block type="variables_get" id="0VEOXL=dG^U=$(G;aNP9"><field name="VAR">计时</field></block></value><next><block type="variables_global" id="NUT..5~]]^a@OByMTK5$"><value name="VAR"><block type="variables_get" id="t+?~tj?PpI?AUUt27MC@"><field name="VAR">开始</field></block></value><next><block type="controls_if" id="WVHw{,_,uQtJ/wb0A.H:"><value name="IF0"><block type="variables_get" id="e}J|UJ(nwy3E{0V0$n|+"><field name="VAR">开始</field></block></value><statement name="DO0"><block type="math_selfcalcu" id="|I22C]zIoa7*$FK]rL7G"><field name="OP">ADD</field><value name="A"><shadow type="variables_get" id="3Yyt]V!S*IBsw}{4aj{B"><field name="VAR">a</field></shadow><block type="variables_get" id=".}Jep|:f~;|D{XwcXr:C"><field name="VAR">计时</field></block></value><value name="B"><shadow type="math_number" id=")nFM8M,!NQd`OSmW46;5"><field name="NUM">1</field></shadow></value></block></statement></block></next></block></next></block></statement></block></xml><config>{}</config><code>aW1wb3J0IG1hY2hpbmUKaW1wb3J0IG1weXRob24KZnJvbSBtcHl0aG9uIGltcG9ydCBvbmJvYXJkX29sZWQKCmRlZiB0aW1fY2FsbGJhY2sodGltKToKICAgIGdsb2JhbCBfRThfQUVfQTFfRTZfOTdfQjYKICAgIGdsb2JhbCBfRTVfQkNfODBfRTVfQTdfOEIKICAgIGlmIF9FNV9CQ184MF9FNV9BN184QjoKICAgICAgICBfRThfQUVfQTFfRTZfOTdfQjYgKz0gMQoKCgpfRTVfQkNfODBfRTVfQTdfOEIgPSBGYWxzZQpfRThfQUVfQTFfRTZfOTdfQjYgPSAwCnRpbSA9IG1hY2hpbmUuVGltZXIoMCkKdGltLmluaXQocGVyaW9kID0gMTAwLCBtb2RlID0gbWFjaGluZS5UaW1lci5QRVJJT0RJQywgY2FsbGJhY2sgPSB0aW1fY2FsbGJhY2spCndoaWxlIFRydWU6CiAgICBpZiBtcHl0aG9uLmJ1dHRvbl9hLndhc19wcmVzc2VkKCk6CiAgICAgICAgX0U1X0JDXzgwX0U1X0E3XzhCID0gbm90IF9FNV9CQ184MF9FNV9BN184QgogICAgaWYgbXB5dGhvbi5idXR0b25fYS53YXNfcHJlc3NlZCgpIGFuZCBub3QgX0U1X0JDXzgwX0U1X0E3XzhCOgogICAgICAgIF9FOF9BRV9BMV9FNl85N19CNiA9IDAKICAgIG9uYm9hcmRfb2xlZC5zaG93cyhzdHIoX0U4X0FFX0ExX0U2Xzk3X0I2KSkK</code>