-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.blocks
37 lines (37 loc) · 16.1 KB
/
main.blocks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="k|qW6SA2AOX1o3!N*r18">strip</variable><variable id="ftDV,qxg`]VhTAqu).%=">left-led</variable><variable id="lFR_AaCQ@yM(EQk+B7G:">right-led</variable><variable id="$rV%~rIvQ#mWzNZzr6_*">range</variable></variables><block type="pxt-on-start" id="(VnfYa5gmz_eSMnKGO%|" x="271" y="-314"><comment pinned="true" h="91.11109924316406" w="158.888916015625">Set up LEDs and assign radio group</comment><statement name="HANDLER"><block type="variables_set" id="C,e5V9D+^pHLJr*VbY{G"><field name="VAR" id="k|qW6SA2AOX1o3!N*r18">strip</field><value name="VALUE"><shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"><field name="NUM">0</field></shadow><block type="neopixel_create" id="W2v,U%@wdemlLbFwNy71"><field name="pin">DigitalPin.P15</field><field name="mode">NeoPixelMode.RGB</field><value name="numleds"><shadow type="math_number" id="L)3eu3rM%|9[bOeN@cRw"><field name="NUM">2</field></shadow></value></block></value><next><block type="variables_set" id="Y|Z{3o.6p7;]U[$Gk(Vs"><field name="VAR" id="ftDV,qxg`]VhTAqu).%=">left-led</field><value name="VALUE"><shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"><field name="NUM">0</field></shadow><block type="neopixel_range" id="3o6/C~ca=0^7PYz%8(TM"><value name="strip"><block type="variables_get" id="{iy:?3~yYgW_kITMC+U_"><field name="VAR" id="k|qW6SA2AOX1o3!N*r18">strip</field></block></value><value name="start"><shadow type="math_number" id="d8!$*.}2|3Kz7Ng;Ay6l"><field name="NUM">0</field></shadow></value><value name="length"><shadow type="math_number" id="}XIoJX*=Q`dj{.dBvB5g"><field name="NUM">1</field></shadow></value></block></value><next><block type="variables_set" id="u[!;ud^[QlHbVA:Ncb1M"><field name="VAR" id="lFR_AaCQ@yM(EQk+B7G:">right-led</field><value name="VALUE"><shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"><field name="NUM">0</field></shadow><block type="neopixel_range" id="Mrhqr!yqL3c:Vuc]}D)N"><value name="strip"><block type="variables_get" id=".?HXgxxSosLW,I2IC0C9"><field name="VAR" id="k|qW6SA2AOX1o3!N*r18">strip</field></block></value><value name="start"><shadow type="math_number" id="8~4[:fs9d-ndfsD]m1[^"><field name="NUM">1</field></shadow></value><value name="length"><shadow type="math_number" id="VKx-c,DdHraP91QpLwi$"><field name="NUM">1</field></shadow></value></block></value><next><block type="radio_set_group" id="L?^LY,!B%:Hg%avVTd)D"><value name="ID"><shadow type="math_number_minmax" id="^J;8Rt%v%;9[Zff#2b4Z"><mutation min="0" max="255" label="Id" precision="0"></mutation><field name="SLIDER">82</field></shadow></value><next><block type="basic_show_icon" id="tri:G`oSo,d~pbcd*Q:."><field name="i">IconNames.Yes</field></block></next></block></next></block></next></block></next></block></statement></block><block type="radio_on_string_drag" id="Vf(-Vq?JEL1c2[s]n1O2" x="-119" y="77"><value name="HANDLER_DRAG_PARAM_receivedString"><shadow type="argument_reporter_string" id="(3SRAQAw(McTR=G@]?.("><field name="VALUE">receivedString</field></shadow></value><statement name="HANDLER"><block type="controls_if" id="mJ$)edxml`=Gmo3UrFu="><mutation elseif="4" else="1"></mutation><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="x)CWPPaqmqaHnG~@d_G#"><field name="OP">EQ</field><value name="A"><shadow type="text"><field name="TEXT"></field></shadow><block type="argument_reporter_string" id="r*f(G!oo*6C%$u{Uk7GL"><field name="VALUE">receivedString</field></block></value><value name="B"><shadow type="text" id="5VhBO^@Z?t,3STaK^]0n"><field name="TEXT">forward</field></shadow></value></block></value><statement name="DO0"><block type="function_call" id="8^kbu}~*W^:eP(+KtQ{m"><mutation name="goForward" functionid="82/CK^nXdrAk02Y=(Ob0"></mutation></block></statement><value name="IF1"><block type="logic_compare" id="^J[Rp,.Wwg4sJPgzGGKt"><field name="OP">EQ</field><value name="A"><shadow type="text"><field name="TEXT"></field></shadow><block type="argument_reporter_string" id="s:2JZdMNuLrvhe.r80Zt"><field name="VALUE">receivedString</field></block></value><value name="B"><shadow type="text" id="of4U3C]FeIUcp|l*lyI$"><field name="TEXT">stop</field></shadow></value></block></value><statement name="DO1"><block type="function_call" id="It2BPf]un-;s8f1=yO8r"><mutation name="stop" functionid="Gx@wJM~$rLO:)jq#gsaH"></mutation></block></statement><value name="IF2"><block type="logic_compare" id="mbFQ?cjmYmF9_u6:$#DF"><field name="OP">EQ</field><value name="A"><shadow type="text"><field name="TEXT"></field></shadow><block type="argument_reporter_string" id="*i{!f,m^!l]6:Yer7xj8"><field name="VALUE">receivedString</field></block></value><value name="B"><shadow type="text" id="L/mkQe$h3ydJdJn)d.~9"><field name="TEXT">left</field></shadow></value></block></value><statement name="DO2"><block type="function_call" id="Fh/A!Rp2@).eoMVdq/p_"><mutation name="turnLeft" functionid="(l3Z;*$)2SPa[PA{ZeV@"></mutation></block></statement><value name="IF3"><block type="logic_compare" id="e)*2oSeH9nA%irwwrjy]"><field name="OP">EQ</field><value name="A"><shadow type="text"><field name="TEXT"></field></shadow><block type="argument_reporter_string" id="8I+W8|xdKQgRBkcNe:E#"><field name="VALUE">receivedString</field></block></value><value name="B"><shadow type="text" id="Rm,$,8V:@yPZ[`2({o:H"><field name="TEXT">right</field></shadow></value></block></value><statement name="DO3"><block type="function_call" id="r}8ME-6944aEZxhc2nh-"><mutation name="turnRight" functionid="(S4I.I!#(J-JRpWk9W-`"></mutation></block></statement><value name="IF4"><block type="logic_compare" id="t{z;t0L|kk_*64uSw|c4"><field name="OP">EQ</field><value name="A"><shadow type="text"><field name="TEXT"></field></shadow><block type="argument_reporter_string" id="v|qWT-{z1}Cr9#g;8H@Y"><field name="VALUE">receivedString</field></block></value><value name="B"><shadow type="text" id="*)/`GzL1GMg*Pl.*f-nI"><field name="TEXT">reverse</field></shadow></value></block></value><statement name="DO4"><block type="function_call" id="7=0;[{VbJxW^LRi0,Jd@"><mutation name="reverse" functionid="PL2Pl~`=%/Nr9W[{2soe"></mutation></block></statement></block></statement></block><block type="function_definition" id="/hSi@^QLdm3:zE*Qj^uG" x="500" y="62"><mutation name="turnRight" functionid="(S4I.I!#(J-JRpWk9W-`"></mutation><field name="function_name">turnRight</field><statement name="STACK"><block type="MotorRun" id="tCizcsB.z_?n9H[Khy8!"><value name="lspeed"><shadow type="math_number_minmax" id="W{PJq4)#,NH2QS3NVtB@"><mutation min="-100" max="100" label="Lspeed" precision="0"></mutation><field name="SLIDER">100</field></shadow></value><value name="rspeed"><shadow type="math_number_minmax" id="4`^W7U*d#qR)N(A:qQ84"><mutation min="-100" max="100" label="Rspeed" precision="0"></mutation><field name="SLIDER">50</field></shadow></value><next><block type="cuteBot_colorLight" id="nsg9F|h:~]yzm|4C|lqm"><field name="light">cuteBot.RGBLights.RGB_R</field><value name="color"><shadow type="colorNumberPicker" id="%uUjZE9Pz850II5LOW;r"><field name="value">0x000000</field></shadow></value><next><block type="cuteBot_colorLight" id="%ATlS4%9s5`/BJ07$*P-"><field name="light">cuteBot.RGBLights.RGB_L</field><value name="color"><shadow type="colorNumberPicker" id="$d!l:k(!F[CZ;3bRo;vE"><field name="value">0x00ff00</field></shadow></value><next><block type="neopixel_set_strip_color" id="}-`ZwVDoOdI7fkc^yDCI"><value name="strip"><block type="variables_get" id="R7_NT[l?hu_lGRN|L*kr"><field name="VAR" id="ftDV,qxg`]VhTAqu).%=">left-led</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="/nzC?.]p_Fu7~U#Ni,HV"><field name="color">NeoPixelColors.Black</field></shadow></value><next><block type="neopixel_set_strip_color" id="#~B!jdyM}P!Iu[Mt/.V$"><value name="strip"><block type="variables_get" id="k{FB+IZ974So*0O0INHo"><field name="VAR" id="lFR_AaCQ@yM(EQk+B7G:">right-led</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="%1xw8*?Iz(Q3thsz6o*w"><field name="color">NeoPixelColors.Green</field></shadow></value><next><block type="device_show_leds" id="H/jV[L;|1j%[@HrGB;s*"><field name="LEDS">`
. . # . .
. # . . .
# # # # #
. # . . .
. . # . .
`</field></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="function_definition" id="=nxq)/rlb.wGsXZ(ilfn" x="1040" y="76"><mutation name="reverse" functionid="PL2Pl~`=%/Nr9W[{2soe"></mutation><field name="function_name">reverse</field><statement name="STACK"><block type="function_call" id="KA)`Qqo8.MPdq2M9s||v"><mutation name="stop" functionid="Gx@wJM~$rLO:)jq#gsaH"></mutation><next><block type="cuteBot_colorLight" id="gj7N?t;q7)SyIjz3g0Pn"><field name="light">cuteBot.RGBLights.RGB_R</field><value name="color"><shadow type="colorNumberPicker" id=",sw[zL;o]ui$hf.teofQ"><field name="value">0xff8000</field></shadow></value><next><block type="cuteBot_colorLight" id=":@j=N~`zRtB5*OXbl3T?"><field name="light">cuteBot.RGBLights.RGB_L</field><value name="color"><shadow type="colorNumberPicker" id="R^({r*8OSq8(t]t]tJzI"><field name="value">0xff8000</field></shadow></value><next><block type="neopixel_set_strip_color" id="Oui;bXj8/9mt_C2t=[%-"><value name="strip"><block type="variables_get" id="JQR0|}V?aYZWfuKJ|MZ-"><field name="VAR" id="lFR_AaCQ@yM(EQk+B7G:">right-led</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="2nt?,.bgv}`e%+cWkrGm"><field name="color">NeoPixelColors.Orange</field></shadow></value><next><block type="neopixel_set_strip_color" id="owXAtU#7;f?4w!1#aak+"><value name="strip"><block type="variables_get" id="+q75?g~?23-g{Sgx,j2V"><field name="VAR" id="ftDV,qxg`]VhTAqu).%=">left-led</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="TuHA1P=VH.|]H_lrcLg0"><field name="color">NeoPixelColors.Orange</field></shadow></value><next><block type="device_pause" id="1#jXO*9]!y[EI*$%7N_*"><value name="pause"><shadow type="timePicker" id="H43EU0Di_vrf872*cO/,"><field name="ms">500</field></shadow></value><next><block type="device_show_leds" id="in}QAE*-PYV(SqjBzTXt"><field name="LEDS">`
. . # . .
. . # . .
# . # . #
. # # # .
. . # . .
`</field><next><block type="cutebot_move_time" id="*=9QrDJ=KEq!j9(P@FNe"><field name="dir">cuteBot.Direction.backward</field><value name="speed"><shadow type="math_number" id="w2^q$0~eBjWA3MjMn{V]"><field name="NUM">50</field></shadow></value><value name="time"><shadow type="math_number" id="Pp{X.(o^pF$+f.p9r.|9"><field name="NUM">2</field></shadow></value><next><block type="device_show_leds" id="hSyI10`thD-2hle@[({i"><field name="LEDS">`
. . . . .
. # # # .
. # # # .
. # # # .
. . . . .
`</field><next><block type="cuteBot_colorLight" id="_53OlJy,!jpEz%;%Gbmp"><field name="light">cuteBot.RGBLights.ALL</field><value name="color"><shadow type="colorNumberPicker" id="_CYd^aKKadMYlzgK,`)t"><field name="value">0xff0000</field></shadow></value><next><block type="neopixel_set_strip_color" id=".S{0I3lguWN)wP*Vs0G@"><value name="strip"><block type="variables_get" id="xdhGG5PUFWr5Iyr3x[Gp"><field name="VAR" id="k|qW6SA2AOX1o3!N*r18">strip</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="AxIf6~]G;{)L3y?xHg(;"><field name="color">NeoPixelColors.Red</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="function_definition" id="KRlr]%m/HXY=D_+]+NX?" x="490" y="649"><mutation name="turnLeft" functionid="(l3Z;*$)2SPa[PA{ZeV@"></mutation><field name="function_name">turnLeft</field><statement name="STACK"><block type="MotorRun" id="Eme]V|.%^Dv|J,)N%cIe"><value name="lspeed"><shadow type="math_number_minmax" id="%LG-HJ;/Nud{`[)Zf78A"><mutation min="-100" max="100" label="Lspeed" precision="0"></mutation><field name="SLIDER">50</field></shadow></value><value name="rspeed"><shadow type="math_number_minmax" id="jnlV*9A9SezQ|=?#M]%#"><mutation min="-100" max="100" label="Rspeed" precision="0"></mutation><field name="SLIDER">100</field></shadow></value><next><block type="cuteBot_colorLight" id="C_~M}LqIu}b^!4Mc$c0J"><field name="light">cuteBot.RGBLights.RGB_R</field><value name="color"><shadow type="colorNumberPicker" id="bU;]{[[eJM*}zzZ!VW.I"><field name="value">0x00ff00</field></shadow></value><next><block type="cuteBot_colorLight" id="fV/yT2}xvqzv!g0-sXKL"><field name="light">cuteBot.RGBLights.RGB_L</field><value name="color"><shadow type="colorNumberPicker" id="v56)LD}_z5?x6/ab!!Ym"><field name="value">0x000000</field></shadow></value><next><block type="neopixel_set_strip_color" id="@^rXUYPAFyB3v!OqMY7D"><value name="strip"><block type="variables_get" id="#F`^h$k|(9gz(m8icq3}"><field name="VAR" id="ftDV,qxg`]VhTAqu).%=">left-led</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="zs)A3gy[8wlf3$=eX,G~"><field name="color">NeoPixelColors.Green</field></shadow></value><next><block type="neopixel_set_strip_color" id="!J0avJN:wa0jjP_@OBye"><value name="strip"><block type="variables_get" id="OiZ?MTqaKIcYMQgi;9BV"><field name="VAR" id="lFR_AaCQ@yM(EQk+B7G:">right-led</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="MuP_`EP5`I)T.]5=TzH8"><field name="color">NeoPixelColors.Black</field></shadow></value><next><block type="device_show_leds" id="@t6P8[2_Gx~jJ+PRMsy5"><field name="LEDS">`
. . # . .
. . . # .
# # # # #
. . . # .
. . # . .
`</field></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="function_definition" id="AD:TJ!,y@}|W6D#k5zRO" x="-119" y="820"><mutation name="goForward" functionid="82/CK^nXdrAk02Y=(Ob0"></mutation><field name="function_name">goForward</field><statement name="STACK"><block type="MotorRun" id="0#kR|B;3y[jV[iEnfKY["><value name="lspeed"><shadow type="math_number_minmax" id="t[ZacAN%(GzX{aqsc2=r"><mutation min="-100" max="100" label="Lspeed" precision="0"></mutation><field name="SLIDER">100</field></shadow></value><value name="rspeed"><shadow type="math_number_minmax" id="K8@/vCmO)Pu4u?DbHueG"><mutation min="-100" max="100" label="Rspeed" precision="0"></mutation><field name="SLIDER">100</field></shadow></value><next><block type="cuteBot_colorLight" id="YnqM^,gA0C/WGvh=NR^k"><field name="light">cuteBot.RGBLights.ALL</field><value name="color"><shadow type="colorNumberPicker" id=")0X/5Zb7r)!yxI_d%y4V"><field name="value">0x00ff00</field></shadow></value><next><block type="neopixel_set_strip_color" id="}$Y2#q}/nx4E@*?vw0eZ"><value name="strip"><block type="variables_get" id="9fkgiI52m`ev$_BV)+a]"><field name="VAR" id="k|qW6SA2AOX1o3!N*r18">strip</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="E.77XeK~JW_s6zOwlE[X"><field name="color">NeoPixelColors.Green</field></shadow></value><next><block type="device_show_leds" id=".v9_VY7(5=2AMo$;Ci:;"><field name="LEDS">`
. . # . .
. # # # .
# . # . #
. . # . .
. . # . .
`</field></block></next></block></next></block></next></block></statement></block><block type="function_definition" id="a|Xo~o;_`@|nc9^*a(MI" x="1040" y="1086"><mutation name="stop" functionid="Gx@wJM~$rLO:)jq#gsaH"></mutation><field name="function_name">stop</field><statement name="STACK"><block type="cutebot_stopcar" id="/F#`pF^y99zul@CxM1[("><next><block type="cuteBot_colorLight" id="n:MnrLTCoKhXM_WCfEjF"><field name="light">cuteBot.RGBLights.ALL</field><value name="color"><shadow type="colorNumberPicker" id="W%E6JYMwdEZ*W#sqt2z^"><field name="value">0xff0000</field></shadow></value><next><block type="neopixel_set_strip_color" id="4w.+=$J]-IY{i$DU.!ZK"><value name="strip"><block type="variables_get" id="jHP`#)m-/U8FMNpib2u#"><field name="VAR" id="k|qW6SA2AOX1o3!N*r18">strip</field></block></value><value name="rgb"><shadow type="neopixel_colors" id="U:+YwMN)9a+GX0?J=}]5"><field name="color">NeoPixelColors.Red</field></shadow></value><next><block type="device_show_leds" id="n.^9C0t36cfD3=U3@1qP"><field name="LEDS">`
. . . . .
. # # # .
. # # # .
. # # # .
. . . . .
`</field></block></next></block></next></block></next></block></statement></block></xml>