-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.blocks
1 lines (1 loc) · 3.56 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="7}=;d=57kXT=.6{RGZ[n">平均距离</variable><variable id="/S|foepbpys@vfb|WFxe">距离</variable></variables><block type="pxt-on-start" id="V_47XXy9(aE~A|%_Wqtc" x="386" y="-153"><statement name="HANDLER"><block type="cbit_CarCtrlSpeed" id="jF=-}8;d064dnJg[p_|J"><field name="index">cbit_小车类.CarState.Car_Stop</field><value name="speed"><shadow type="math_number_minmax" id="H9||V73D+lMQTq82Lksg"><mutation min="0" max="255" label="Speed" precision="0"/><field name="SLIDER">0</field></shadow></value><next><block type="variables_set" id="~~!-7K4sB+(7N=crq=Ex"><field name="VAR" id="/S|foepbpys@vfb|WFxe">距离</field><value name="VALUE"><shadow type="math_number" id="a+^QX[{}1SXX.:DdYES+"><field name="NUM">0</field></shadow></value></block></next></block></statement></block><block type="device_button_event" id="X3)$^{=(tt^td(wZ)d6^" x="69" y="83"><field name="NAME">Button.A</field><statement name="HANDLER"><block type="device_while" id="21V)k4c_A),~g^J!F?|B"><value name="COND"><shadow type="logic_boolean" id=".2u-C.Yrp74?+^2m7w[?"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="cQ,nm303=4+|0MLN%@K#"><field name="VAR" id="/S|foepbpys@vfb|WFxe">距离</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="cbit_ultrasonic" id="RG==t!VGDG)=;k9wfX.g"><field name="Trig">DigitalPin.P1</field><field name="Echo">DigitalPin.P2</field></block></value><next><block type="controls_if" id="8{ct:ul`}YBKRkEqRH^."><mutation else="1"/><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="E_{LjN]cNuFWn=T|gh_@"><field name="OP">LT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="FT1L^vvmvGGXHQ-gf#R`"><field name="VAR" id="/S|foepbpys@vfb|WFxe">距离</field></block></value><value name="B"><shadow type="math_number" id="c%x0dDL3_mi5gteT,GP%"><field name="NUM">15</field></shadow></value></block></value><statement name="DO0"><block type="function_call" id="3^UFdOB(.[Cc;Ac}m#-@"><mutation name="turn_left" functionid="|vpT*vK+Aw|YF7FPDAB%"/></block></statement><statement name="ELSE"><block type="function_call" id="24hzCRHd(w[%mZ()GaM8"><mutation name="go_ahead" functionid="h[,7_%[`S8^$U6$CIHr`"/></block></statement></block></next></block></statement></block></statement></block><block type="function_definition" id="38.u%Hulx~jlyBCr;a^8" x="835" y="107"><mutation name="turn_left" functionid="|vpT*vK+Aw|YF7FPDAB%"/><field name="function_name">turn_left</field><comment>左转</comment><statement name="STACK"><block type="cbit_CarCtrlSpeed" id="scb]X?:@{ua~x.UpvUP~"><field name="index">cbit_小车类.CarState.Car_SpinLeft</field><value name="speed"><shadow type="math_number_minmax" id="~Lj3%t`jq#_4G/}*va|!"><mutation min="0" max="255" label="Speed" precision="0"/><field name="SLIDER">150</field></shadow></value></block></statement></block><block type="function_definition" id="JFEB}bh0*+k/JPoB0g1D" x="655" y="356"><mutation name="go_ahead" functionid="h[,7_%[`S8^$U6$CIHr`"/><field name="function_name">go_ahead</field><comment>前进</comment><statement name="STACK"><block type="cbit_CarCtrlSpeed" id="ipQTFloa}vfr)HB(zplB"><field name="index">cbit_小车类.CarState.Car_Run</field><value name="speed"><shadow type="math_number_minmax" id="kVLUUT0MPzxYfUk9C/[;"><mutation min="0" max="255" label="Speed" precision="0"/><field name="SLIDER">150</field></shadow></value></block></statement></block></xml>