-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.blocks
1 lines (1 loc) · 6.01 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="u18Q(5+5,5R2)98T~O8j">sensorRight</variable><variable id="!Z!QdTxH)|O=tx((4=6c">sensorLeft</variable><variable id="IX()J=MBkGaEY2x?t_`M">counter</variable></variables><block type="pxt-on-start" x="0" y="0"><statement name="HANDLER"><block type="typescript_statement" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="let counter = 0" numlines="1" declaredvars="counter"></mutation><next><block type="serial_redirect_to_usb"><next><block type="device_set_pull"><field name="pin">DigitalPin.P15</field><field name="pull">PinPullMode.PullUp</field><next><block type="device_set_pull"><field name="pin">DigitalPin.P16</field><field name="pull">PinPullMode.PullUp</field></block></next></block></next></block></next></block></statement></block><block type="device_forever" x="391" y="0"><statement name="HANDLER"><block type="variables_set"><field name="VAR" id="u18Q(5+5,5R2)98T~O8j">sensorRight</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_digital_pin"><field name="name">DigitalPin.P15</field></block></value><next><block type="variables_set"><field name="VAR" id="!Z!QdTxH)|O=tx((4=6c">sensorLeft</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_digital_pin"><field name="name">DigitalPin.P16</field></block></value><next><block type="serial_writestring"><value name="text"><block type="text_join" inline="false"><mutation items="6"/><value name="ADD0"><shadow type="text"><field name="TEXT"/></shadow><block type="typescript_expression" editable="false"><field name="EXPRESSION">counter.toString()</field></block></value><value name="ADD1"><shadow type="text"><field name="TEXT">: R[</field></shadow></value><value name="ADD2"><shadow type="text"><field name="TEXT"/></shadow><block type="variables_get"><field name="VAR" id="u18Q(5+5,5R2)98T~O8j">sensorRight</field></block></value><value name="ADD3"><shadow type="text"><field name="TEXT">] L[</field></shadow></value><value name="ADD4"><shadow type="text"><field name="TEXT"/></shadow><block type="variables_get"><field name="VAR" id="!Z!QdTxH)|O=tx((4=6c">sensorLeft</field></block></value><value name="ADD5"><shadow type="text"><field name="TEXT">]</field></shadow></value></block></value><next><block type="serial_writeline"><value name="text"><shadow type="text"><field name="TEXT"/></shadow></value><next><block type="controls_if"><mutation elseif="2"/><comment pinned="false" h="80" w="160">move forward turn left turn right</comment><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_operation"><field name="OP">AND</field><value name="A"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get"><field name="VAR" id="u18Q(5+5,5R2)98T~O8j">sensorRight</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></value><value name="B"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get"><field name="VAR" id="!Z!QdTxH)|O=tx((4=6c">sensorLeft</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></value></block></value><value name="IF1"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_operation"><field name="OP">AND</field><value name="A"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get"><field name="VAR" id="u18Q(5+5,5R2)98T~O8j">sensorRight</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></value><value name="B"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get"><field name="VAR" id="!Z!QdTxH)|O=tx((4=6c">sensorLeft</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></value></block></value><value name="IF2"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_operation"><field name="OP">AND</field><value name="A"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get"><field name="VAR" id="u18Q(5+5,5R2)98T~O8j">sensorRight</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></value><value name="B"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get"><field name="VAR" id="!Z!QdTxH)|O=tx((4=6c">sensorLeft</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></value></block></value><next><block type="variables_change"><field name="VAR" id="IX()J=MBkGaEY2x?t_`M">counter</field><value name="VALUE"><shadow type="math_number"><field name="NUM">1</field></shadow></value><next><block type="typescript_statement" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="pause(100)" numlines="1"></mutation></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>