-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.blocks
27 lines (26 loc) · 12 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
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="ES;n[9s/!hap7?OhE,P^">sprite</variable></variables><block type="function_definition" id="AR:KSDwhc,{:(eJXIWy6" collapsed="true" x="-442" y="-235"><mutation name="Forward" functionid="pAe^NTp^J3wL_TNj[3pi"><arg name="num" id="#jA5Z-dmT/IYhQJtCKlF" type="number"></arg><arg name="sprite2" id="W0S#jYU%nw)ZU^HETdz+" type="game.LedSprite"></arg></mutation><field name="function_name">Forward</field><value name="#jA5Z-dmT/IYhQJtCKlF"><shadow type="argument_reporter_number" id="{/-5Ql5uvJ*EA1S6nL5#"><field name="VALUE">num</field></shadow></value><value name="W0S#jYU%nw)ZU^HETdz+"><shadow type="argument_reporter_custom" id="mn)Y#f`ubXgH:X5-uGEZ"><mutation typename="game.LedSprite"></mutation><field name="VALUE">sprite2</field></shadow></value><statement name="STACK"><block type="motor_MotorRun" id="t:2$LO_9@YY,=cm`!UvW"><field name="index">maqueen.Motors.All</field><field name="Dir">maqueen.Dir.CW</field><value name="speed"><shadow type="math_number_minmax" id="R@)~m9hLN@i|1Y]U!I[;"><mutation min="0" max="255" label="Number" precision="0"></mutation><field name="SLIDER">100</field></shadow><block type="argument_reporter_number" id="{BF0!]kd^jz8auKDR(f@"><field name="VALUE">num</field></block></value><next><block type="device_show_leds" id="Eq(`St7C$o_,g4v6mmpM"><field name="LEDS">`
. . # . .
. # # # .
# . # . #
. . # . .
. . # . .
`</field></block></next></block></statement></block><block type="pxt-on-start" id="?1IC]uu0:7[Ga~UCA2jW" x="1" y="-222"><statement name="HANDLER"><block type="makerbit_infrared_connect_receiver" id="mRmRIay[VXtV+6wo=:qe"><field name="pin">DigitalPin.P16</field><field name="protocol">IrProtocol.NEC</field><comment pinned="false" h="80" w="160">This program uses the Maqueen extension and also the MakerBit IR Receiver extension.
It is necessary to use the NEC format and ensure the IR receiver is connected to P16</comment><next><block type="basic_show_icon" id="[email protected][4#u5?}YgjXh"><field name="i">IconNames.Happy</field></block></next></block></statement></block><block type="function_definition" id="Uv^=OqL5kBU4[W5%[MZC" collapsed="true" x="-444" y="-88"><mutation name="Backward" functionid="~Rw)z`FI|1K!*c}gE%K$"><arg name="num" id="QQnNAT5e?^*2SiZAZgZK" type="number"></arg></mutation><field name="function_name">Backward</field><value name="QQnNAT5e?^*2SiZAZgZK"><shadow type="argument_reporter_number" id=":{RnVrf6T{)L-DSA~SAQ"><field name="VALUE">num</field></shadow></value><statement name="STACK"><block type="motor_MotorRun" id="~^Yk@gL4uy[P91):G?ei"><field name="index">maqueen.Motors.All</field><field name="Dir">maqueen.Dir.CCW</field><value name="speed"><shadow type="math_number_minmax" id="h;7Im34.g[{oEY5%lk/~"><mutation min="0" max="255" label="Number" precision="0"></mutation><field name="SLIDER">100</field></shadow><block type="argument_reporter_number" id="L-x!7La;)+~4:!5/5pRv"><field name="VALUE">num</field></block></value><next><block type="device_show_leds" id="G#18*,o)~X$/-W9wLzX1"><field name="LEDS">`
. . # . .
. . # . .
# . # . #
. # # # .
. . # . .
`</field></block></next></block></statement></block><block type="makerbit_infrared_on_ir_datagram" id="a59_w[wRUiuG.YEB},])" x="0" y="0"><statement name="HANDLER"><block type="motor_motorStop" id="k0TN*st2BeM7p4R9m^}S"><field name="motors">maqueen.Motors.All</field><next><block type="device_play_note" id="|A=N!.6UY=g1^x;l!oWP"><value name="note"><shadow type="device_note" id="^9vu;6N6M-3;@(3)NB}5"><field name="name">262</field></shadow></value><value name="duration"><shadow type="device_beat" id="0Loob@_IVq#P^%}W|#:J"><field name="fraction">BeatFraction.Whole</field></shadow></value><next><block type="basic_show_icon" id="nwc.#Z{K{H4Di%C:Y:WB"><field name="i">IconNames.Yes</field><next><block type="controls_if" id="vP_WhDgb,M!I}@`vGvlX"><mutation elseif="3" else="1"></mutation><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="string_includes" id="a.1{Lqt.L#QmZW^tyz93"><value name="this"><shadow type="text"><field name="TEXT"></field></shadow><block type="variable_to_text" id="2?r]aZ#RLx_$|Pes{~MI"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_ir_datagram" id="(hK:xJ6|D^CypT=`NBjS"></block></value></block></value><value name="searchValue"><shadow type="text" id="${{Qr]oAL((@fLO?E13k"><field name="TEXT">FF02FD</field></shadow></value></block></value><statement name="DO0"><block type="function_call" id="yjOrwR-fplgn!Hf}Bd4["><mutation name="Forward" functionid="pAe^NTp^J3wL_TNj[3pi"><arg name="num" id="#jA5Z-dmT/IYhQJtCKlF" type="number"></arg><arg name="sprite2" id="W0S#jYU%nw)ZU^HETdz+" type="game.LedSprite"></arg></mutation><value name="#jA5Z-dmT/IYhQJtCKlF"><shadow type="math_number" id="rPx0:M@-o%ddJsEr~bQ5"><field name="NUM">100</field></shadow></value><value name="W0S#jYU%nw)ZU^HETdz+"><shadow type="variables_get" id="+[I!UoXM!#]u;Q6r%*I."><field name="VAR" id="ES;n[9s/!hap7?OhE,P^">sprite</field></shadow></value></block></statement><value name="IF1"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="string_includes" id="*v0glhZ.?,SkCiz#,Ym*"><value name="this"><shadow type="text"><field name="TEXT"></field></shadow><block type="variable_to_text" id="B9Dm.lz7Ukj,CdsZvUNs"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_ir_datagram" id="t|xw8`BtKI2{|tD@@Q35"></block></value></block></value><value name="searchValue"><shadow type="text" id="HvW.vJ~^AqW!bR$Bk!wE"><field name="TEXT">FF22DD</field></shadow></value></block></value><statement name="DO1"><block type="function_call" id="g{QzZu%[|XL!]c_R`!UY"><mutation name="Backward" functionid="~Rw)z`FI|1K!*c}gE%K$"><arg name="num" id="QQnNAT5e?^*2SiZAZgZK" type="number"></arg></mutation><value name="QQnNAT5e?^*2SiZAZgZK"><shadow type="math_number" id="koTp-B#dJyCWFd]WDWk3"><field name="NUM">100</field></shadow></value></block></statement><value name="IF2"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="string_includes" id="U)%@2DSyt8Ny_QeG._bB"><value name="this"><shadow type="text"><field name="TEXT"></field></shadow><block type="variable_to_text" id="s,VGK3UWn[@VN1~7@9Z,"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_ir_datagram" id="([Q)1ED6peIY#,;,sgEx"></block></value></block></value><value name="searchValue"><shadow type="text" id="P%`#)2_[1sHSAOo:-fX7"><field name="TEXT">FFA25D</field></shadow></value></block></value><statement name="DO2"><block type="function_call" id=".4OQqI6~S}+dDw%R~Bsl"><mutation name="Left" functionid="0q,]in%G!X{oBB-`{|bS"><arg name="num" id="yT1N*bBUrp]44/)6o9Po" type="number"></arg></mutation><value name="yT1N*bBUrp]44/)6o9Po"><shadow type="math_number" id="P~2yZs([_6|$:4qP(MY?"><field name="NUM">100</field></shadow></value></block></statement><value name="IF3"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="string_includes" id="7ETTPBvrf[D_QU[nP+QN"><value name="this"><shadow type="text"><field name="TEXT"></field></shadow><block type="variable_to_text" id="X*!8rn8a7aZ*ISit6+v?"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_ir_datagram" id="rJ)a(-45mSZi/._1LuHn"></block></value></block></value><value name="searchValue"><shadow type="text" id="TY`Q2{n4F+27WH;DI;Xr"><field name="TEXT">FFE21D</field></shadow></value></block></value><statement name="DO3"><block type="function_call" id="qb8NS?jsC8;ubSOWJgT-"><mutation name="Right" functionid="UCF;bbRj$n7Yx_t{U-c."><arg name="num" id=";#2,oJF-B`M-p6PuI)o|" type="number"></arg></mutation><value name=";#2,oJF-B`M-p6PuI)o|"><shadow type="math_number" id="nR}zqN+.0rH4=tw6wSc8"><field name="NUM">100</field></shadow></value></block></statement><statement name="ELSE"><block type="motor_motorStop" id="_hbnGOMeXiS^;|+t9We$"><field name="motors">maqueen.Motors.All</field><next><block type="basic_show_icon" id="n7Q7ha;(=vAI=]u~L!oZ"><field name="i">IconNames.No</field></block></next></block></statement></block></next></block></next></block></next></block></statement></block><block type="function_definition" id="3Ef?4iYr5ab1yZiJ[0(^" collapsed="true" x="-449" y="51"><mutation name="Left" functionid="0q,]in%G!X{oBB-`{|bS"><arg name="num" id="yT1N*bBUrp]44/)6o9Po" type="number"></arg></mutation><field name="function_name">Left</field><value name="yT1N*bBUrp]44/)6o9Po"><shadow type="argument_reporter_number" id="a7!6$A~-s.,HiAK=sw}K"><field name="VALUE">num</field></shadow></value><statement name="STACK"><block type="motor_MotorRun" id="3Ho5`NQ=/`@HeR^h9CO/"><field name="index">maqueen.Motors.M1</field><field name="Dir">maqueen.Dir.CCW</field><value name="speed"><shadow type="math_number_minmax" id=".CAQs(N^[_6Q29ke*YF}"><mutation min="0" max="255" label="Number" precision="0"></mutation><field name="SLIDER">70</field></shadow><block type="argument_reporter_number" id="jUIlQ!_BxAEflPU|tY17"><field name="VALUE">num</field></block></value><next><block type="motor_MotorRun" id="6OCx_K2:[Id_3q--5]CX"><field name="index">maqueen.Motors.M2</field><field name="Dir">maqueen.Dir.CW</field><value name="speed"><shadow type="math_number_minmax" id="Qbo%Ku!_pn2!Au@UqBzS"><mutation min="0" max="255" label="Number" precision="0"></mutation><field name="SLIDER">70</field></shadow><block type="argument_reporter_number" id="-9a~#1B`7#a3J^l;+t%d"><field name="VALUE">num</field></block></value><next><block type="device_show_leds" id="n5la],7osC^EkDu`2oTc"><field name="LEDS">`
. . # . .
. . . # .
# # # # #
. . . # .
. . # . .
`</field><next><block type="device_pause" id=";|wn}}r+*{CJ8O}]~wxy"><value name="pause"><shadow type="timePicker" id=",!2@A)]9W8@0(Agdu}wn"><field name="ms">300</field></shadow></value><next><block type="motor_motorStop" id=".ey%sQ,VuyK-$Npz_)6P"><field name="motors">maqueen.Motors.All</field></block></next></block></next></block></next></block></next></block></statement></block><block type="function_definition" id="7m*|eu_W+5W:UZO7{#?B" collapsed="true" x="-450" y="184"><mutation name="Right" functionid="UCF;bbRj$n7Yx_t{U-c."><arg name="num" id=";#2,oJF-B`M-p6PuI)o|" type="number"></arg></mutation><field name="function_name">Right</field><value name=";#2,oJF-B`M-p6PuI)o|"><shadow type="argument_reporter_number" id="!Kp/ote(v3#N*~RSOJ21"><field name="VALUE">num</field></shadow></value><statement name="STACK"><block type="motor_MotorRun" id="qlzg%+,/T@j7g#5X0H(Q"><field name="index">maqueen.Motors.M1</field><field name="Dir">maqueen.Dir.CW</field><value name="speed"><shadow type="math_number_minmax" id=",BxDbVgK3dMy+~lkm3CN"><mutation min="0" max="255" label="Number" precision="0"></mutation><field name="SLIDER">70</field></shadow><block type="argument_reporter_number" id="^gY0GnVGy#%$mUPam:e8"><field name="VALUE">num</field></block></value><next><block type="motor_MotorRun" id="~uoY3m@GXKU{cTeE;fGU"><field name="index">maqueen.Motors.M2</field><field name="Dir">maqueen.Dir.CCW</field><value name="speed"><shadow type="math_number_minmax" id="vn3GAi%oaMr#}@!Xzfhs"><mutation min="0" max="255" label="Number" precision="0"></mutation><field name="SLIDER">70</field></shadow><block type="argument_reporter_number" id="zQs)3STCRLu~hkJW,0KD"><field name="VALUE">num</field></block></value><next><block type="device_show_leds" id="qS[4=-=;xIE~0xP[%w#7"><field name="LEDS">`
. . # . .
. # . . .
# # # # #
. # . . .
. . # . .
`</field><next><block type="device_pause" id="(}S|xK=QUIdm:Y91W5Cg"><value name="pause"><shadow type="timePicker" id="t{$1yk]x$[0[vK`WL]3y"><field name="ms">300</field></shadow></value><next><block type="motor_motorStop" id="BG~2Dkl@hYYUauFLu;7;"><field name="motors">maqueen.Motors.All</field></block></next></block></next></block></next></block></next></block></statement></block><block type="IR_IR_read" id="TK`*+y2vt#d%hLZ)oqi2" disabled="true" x="192" y="663"></block></xml>