-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.blocks
1 lines (1 loc) · 6.1 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><block type="pxt-on-start" x="0" y="0"><statement name="HANDLER"><block type="makerbit_infrared_connect_receiver"><field name="pin">DigitalPin.P1</field><field name="protocol">Robotic.IrProtocol.NEC</field></block></statement></block><block type="device_button_event" x="553" y="0"><field name="NAME">Button.B</field><statement name="HANDLER"><block type="robotic_set_motor"><field name="index">Robotic.Motors.MAll</field><field name="direction">Robotic.Dir.CW</field><value name="speed"><shadow type="math_number_minmax"><mutation min="0" max="255" label="Number" precision="0"/><field name="SLIDER">206</field></shadow></value><next><block type="device_pause"><value name="pause"><shadow type="timePicker"><field name="ms">1000</field></shadow></value><next><block type="robotic_set_motor"><field name="index">Robotic.Motors.MAll</field><field name="direction">Robotic.Dir.CCW</field><value name="speed"><shadow type="math_number_minmax"><mutation min="0" max="255" label="Number" precision="0"/><field name="SLIDER">156</field></shadow></value><next><block type="device_pause"><value name="pause"><shadow type="timePicker"><field name="ms">1000</field></shadow></value><next><block type="robotic_stop_motor"><field name="index">Robotic.Motors.MAll</field></block></next></block></next></block></next></block></next></block></statement></block><block type="controls_if" disabled="true" x="1008" y="0"><mutation elseif="4" else="1"/><value name="IF0"><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="makerbit_infrared_ir_button_pressed"/></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_button_code"><field name="button">Robotic.IrButton.Number_2</field></block></value></block></value><statement name="DO0"><block type="robotic_set_motor"><field name="index">Robotic.Motors.MAll</field><field name="direction">Robotic.Dir.CW</field><value name="speed"><shadow type="math_number_minmax"><mutation min="0" max="255" label="Number" precision="0"/><field name="SLIDER">200</field></shadow></value></block></statement><value name="IF1"><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="makerbit_infrared_ir_button_pressed"/></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_button_code"><field name="button">Robotic.IrButton.Number_4</field></block></value></block></value><statement name="DO1"><block type="robotic_set_four_motor"><value name="speedMotor1"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">-200</field></shadow></value><value name="speedMotor2"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">200</field></shadow></value><value name="speedMotor3"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">200</field></shadow></value><value name="speedMotor4"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">-200</field></shadow></value></block></statement><value name="IF2"><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="makerbit_infrared_ir_button_pressed"/></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_button_code"><field name="button">Robotic.IrButton.Number_6</field></block></value></block></value><statement name="DO2"><block type="robotic_set_four_motor"><value name="speedMotor1"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">200</field></shadow></value><value name="speedMotor2"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">-200</field></shadow></value><value name="speedMotor3"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">-200</field></shadow></value><value name="speedMotor4"><shadow type="math_number_minmax"><mutation min="-255" max="255" label="Number" precision="0"/><field name="SLIDER">200</field></shadow></value></block></statement><value name="IF3"><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="makerbit_infrared_ir_button_pressed"/></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_button_code"><field name="button">Robotic.IrButton.Number_8</field></block></value></block></value><statement name="DO3"><block type="robotic_set_motor"><field name="index">Robotic.Motors.MAll</field><field name="direction">Robotic.Dir.CCW</field><value name="speed"><shadow type="math_number_minmax"><mutation min="0" max="255" label="Number" precision="0"/><field name="SLIDER">200</field></shadow></value></block></statement><value name="IF4"><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="makerbit_infrared_ir_button_pressed"/></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="makerbit_infrared_button_code"><field name="button">Robotic.IrButton.Number_5</field></block></value></block></value><statement name="DO4"><block type="robotic_stop_motor"><field name="index">Robotic.Motors.MAll</field></block></statement></block></xml>