-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.blocks
More file actions
38 lines (37 loc) · 8.84 KB
/
Copy pathmain.blocks
File metadata and controls
38 lines (37 loc) · 8.84 KB
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
38
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="nAD(~?h$u5|LxZQXUUi,">data</variable></variables><comment id="lSMxrirN$FBFbuPH0B0|" minimized="true" x="0" y="0" h="140" w="738">02_ControllerProgram_v1
マイコンロボット(クローラータイプ)向け コントローラー用プログラム
Programs a controller for the Tamiya Microcomputer Robot (Crawler Type).</comment><block type="pxt-on-start" id="Xd[K)Oh(;Uz@#`V4DPbG" x="-7" y="187"><comment pinned="false" h="102" w="380">プログラムが動き出したときに一度だけ行う
Runs once when the program starts.
</comment><statement name="HANDLER"><block type="basic_show_icon" id="SA2*%AW44:HtO}(}7y8`"><field name="i">IconNames.SmallSquare</field><next><block type="basic_show_icon" id="Ohkc6/(cs!9wdU+]*8hu"><field name="i">IconNames.Square</field><next><block type="radio_set_group" id=";S6$0%PH%h?pASgbyrfM"><comment pinned="false" h="103" w="614">グループ37のBBC micro:bit同士で通信するように設定する
Allows communication between BBC micro:bits assigned to group 37.
</comment><value name="ID"><shadow type="math_number" id="6Jto);k/)yLTErZ#[ky3"><field name="NUM">37</field></shadow></value><next><block type="radio_set_transmit_power" id="y41D|DOhib3wt+g2z:s="><comment pinned="false" h="107" w="370">電波の強さを7(最大)に設定する
Sets signal strength to 7 (maximum).
</comment><value name="power"><shadow type="math_number" id="1==mj;eUO0O|R!PWCG)]"><field name="NUM">7</field></shadow></value><next><block type="device_pause" id=",~_JZ??9)7FBk5Nq2,:d"><value name="pause"><shadow type="timePicker" id="^?JaWOvmD:gLvp;C1Kpy"><field name="ms">100</field></shadow></value><next><block type="device_clear_display" id="ypsBPE]j-Ji6X3`?b*xf"><next><block type="device_print_message" id="B!+Yza-rcYvy9pY*J.P]"><comment pinned="false" h="105" w="298">P02を表示する(プログラムNo.2)
Shows P02 (Program no.2)
</comment><value name="text"><shadow type="text" id="(apRCIgY^?Lg}=]yxDOI"><field name="TEXT">P02</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="device_button_event" id="L5:xk{gFyX8{CjppqM(T" x="345" y="182"><field name="NAME">Button.A</field><statement name="HANDLER"><block type="variables_set" id="(mu,tuO=M%7aZ_19nPrA"><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field><comment pinned="false" h="136" w="317">送信データを555に設定する
(前進指令)
Sets transmitted data to 555
(command for forward movement).
</comment><value name="VALUE"><shadow type="math_number" id="4#Zru#mo!r]DO^rHw2B0"><field name="NUM">555</field></shadow></value><next><block type="basic_show_arrow" id="XM]`1];~L;,!tQ|D:lX7"><value name="i"><shadow type="device_arrow" id="$x,%T2jvs30mQ4zPi!F2"><field name="arrow">ArrowNames.North</field></shadow></value></block></next></block></statement></block><block type="device_forever" id="h$}S@r6+OW`]}v}[mMZ-" x="725" y="185"><comment pinned="false" h="105" w="291">繰り返し行う
Block repeats continuously.
</comment><statement name="HANDLER"><block type="controls_if" id="ylyvlV1swoXD|v|ca`.`"><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_operation" id="z~R-!|!/BgIXV@SH09^P"><field name="OP">AND</field><comment pinned="false" h="102" w="302">ボタンが押されなかったなら
If no button is pressed...
</comment><value name="A"><block type="logic_compare" id="HEZaNJw-IrsfMF`W.^~*"><field name="OP">NEQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="Q{;65ts3XDwuEz|c0AdP"><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field></block></value><value name="B"><shadow type="math_number" id="bN+;-3UmB$xcC{E?+_mA"><field name="NUM">555</field></shadow></value></block></value><value name="B"><block type="logic_compare" id="Iv-:0n*G.)wi1zO@qEtk"><field name="OP">NEQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="[o_$@yXrJW[F;GaLWceP"><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field></block></value><value name="B"><shadow type="math_number" id="f=`;BD(jJE#{Q+?+3KKM"><field name="NUM">666</field></shadow></value></block></value></block></value><statement name="DO0"><block type="controls_if" id=")IYU/PL%q?mc8#DUkawD"><mutation elseif="1" else="1"></mutation><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="tvV)qVo[{DkO:Ea!3Ekf"><field name="OP">LTE</field><comment pinned="false" h="120" w="319">左に10°以上傾けたなら
If controller is tilted more than 10 degrees to the left...
</comment><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_rotation" id="r(*!q[ZUff9Z:yJ#|kxH"><field name="NAME">Rotation.Roll</field></block></value><value name="B"><shadow type="math_number" id="B{G%a-H-$Ny_T[akF6#N"><field name="NUM">-10</field></shadow></value></block></value><statement name="DO0"><block type="variables_set" id="^|J27BruoTEn:GFm@z~,"><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field><comment pinned="false" h="133" w="365">送信データを傾き量に設定する
(旋回指令)
Sets transmitted data to tilt angle (command for turn).
</comment><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_rotation" id="8-rqID0`v;zGVs8xLU%@"><field name="NAME">Rotation.Roll</field></block></value><next><block type="basic_show_arrow" id="wS9?n;;e$iAw(WCk(v8p"><value name="i"><shadow type="device_arrow" id="(c6F03``wdFS[$eM(^Zn"><field name="arrow">ArrowNames.West</field></shadow></value></block></next></block></statement><value name="IF1"><block type="logic_compare" id="-Vr4:FOiQoh4czoaz|6X"><field name="OP">GTE</field><comment pinned="false" h="115" w="311">右に10°以上傾けたなら
If controller is tilted more than 10 degrees to the right...
</comment><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_rotation" id="AL9wqyG=_@O?xK:H=S%/"><field name="NAME">Rotation.Roll</field></block></value><value name="B"><shadow type="math_number" id="}KR%k:mExA5/#{*rlZl?"><field name="NUM">10</field></shadow></value></block></value><statement name="DO1"><block type="variables_set" id="gh{ORPNq1#d4^BZjBT{*"><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field><comment pinned="false" h="136" w="368">送信データを傾き量に設定する
(旋回指令)
Sets transmitted data to tilt angle (command for turn).
</comment><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_rotation" id="D%vrUnJWgyO+O@#2mi~d"><field name="NAME">Rotation.Roll</field></block></value><next><block type="basic_show_arrow" id="t|In77G]c_E1zI~e(OjB"><value name="i"><shadow type="device_arrow" id="%_v,kEe2E|Y0ltt}7CMj"><field name="arrow">ArrowNames.East</field></shadow></value></block></next></block></statement><statement name="ELSE"><block type="basic_show_icon" id="v8`aw3?_Xfwt/}nVm3fw"><field name="i">IconNames.Target</field></block></statement></block></statement><next><block type="radio_datagram_send" id="9hN:u:?Cr|:d[+tVeN}V"><comment pinned="false" h="120" w="160">送信データを送る
Transmits data.
</comment><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="k*$tz.Y+fiKqTUO}!7{K"><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field></block></value><next><block type="variables_set" id="IK6:zM@]HN},VLVth7{w"><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field><comment pinned="false" h="106" w="308">送信データを0にリセットする
Resets transmitted data to 0.
</comment><value name="VALUE"><shadow type="math_number" id="F$fSAN[VH97Gy|k{tsOO"><field name="NUM">0</field></shadow></value></block></next></block></next></block></statement></block><block type="device_button_event" id="Iej=dOxpp.8-9H_f|qCD" x="348" y="423"><field name="NAME">Button.B</field><statement name="HANDLER"><block type="variables_set" id="?/#iszUG6$7YeQgNXd@["><field name="VAR" id="nAD(~?h$u5|LxZQXUUi,">data</field><comment pinned="false" h="142" w="350">送信データを666に設定する
(後進指令)
Sets transmitted data to 666
(command for reverse movement).
</comment><value name="VALUE"><shadow type="math_number" id="x}Wb[a5!MH|xUHo`==6B"><field name="NUM">666</field></shadow></value><next><block type="basic_show_arrow" id="?OKvybcz}EG}8bxEy]CN"><value name="i"><shadow type="device_arrow" id=";7?TQPZ`:FlcJCW@d;ld"><field name="arrow">ArrowNames.South</field></shadow></value></block></next></block></statement></block></xml>