-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.blocks
1 lines (1 loc) · 9.66 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="9-b}(wF$C38(E?mB@T0`">sensorSensitivity</variable><variable id="1v*u:l#WBl$?BW!@5wKK">speed</variable><variable id="Ayg,B1jb;@or-EvfU/|6">driving</variable><variable id=".OO![B(5.(Ys,y.{ah}-">rightSensor</variable><variable id="DXbYA~^hUnRA:u9HMbGU">leftSensor</variable><variable id="Bu19!nDGLfoK,e248j{_">sensorDifference</variable></variables><block type="device_forever" id="w:U=,3%/E(V}rl,(YG@D" x="0" y="0"></block><block type="device_button_event" id="**o638vf:LDn~i{~G4Ef" x="288" y="-5"><field name="NAME">Button.A</field><statement name="HANDLER"><block type="kitronik_move_motor_motor_balance" id="Bg8K=2G)^hOi7G^8PC@H"><field name="direction">Kitronik_Move_Motor.SpinDirections.Right</field><comment pinned="false" h="80" w="160">Just for this Kitronik Move</comment><value name="balance"><shadow type="math_number_minmax" id="9(5w:$zCJOewF`-kMI[_"><mutation min="0" max="10" label="Number" precision="0"></mutation><field name="SLIDER">3</field></shadow></value><next><block type="kitronik_move_motor_ultrasonic_units" id="`t#M0MBT(ZFesXJfE{#J"><field name="unit">Kitronik_Move_Motor.Units.Centimeters</field><next><block type="variables_set" id=")ta}?3$fHVOWSP_On}t0"><field name="VAR" id="9-b}(wF$C38(E?mB@T0`">sensorSensitivity</field><comment pinned="false" h="80" w="160">Sensitivity of the optical sensor</comment><value name="VALUE"><shadow type="math_number" id="Z#,TV(c:*vPx+_i[u[]."><field name="NUM">10</field></shadow></value><next><block type="variables_set" id="oQ*{:*epQxSBeG*aXFvi"><field name="VAR" id="1v*u:l#WBl$?BW!@5wKK">speed</field><comment pinned="false" h="80" w="160">Speed of the robot</comment><value name="VALUE"><shadow type="math_number" id="F8SCHs[^Jjk3Zr^Q?y8B"><field name="NUM">30</field></shadow></value><next><block type="device_show_number" id="wM/!qK8C)HS[y,1?x{f4"><comment pinned="false" h="80" w="160">count down!</comment><value name="number"><shadow type="math_number" id="f`C@QL[5y%g]3}H,AtvA"><field name="NUM">3</field></shadow></value><next><block type="device_show_number" id="L6}74x-2Imi9x@qV9l_["><value name="number"><shadow type="math_number" id=")BEW5_W9{E*i^Rhv[O[?"><field name="NUM">2</field></shadow></value><next><block type="device_show_number" id="=.elljA0N_I)1sbFmNh3"><value name="number"><shadow type="math_number" id="D4J8A3RrotB(@IO(!B|i"><field name="NUM">1</field></shadow></value><next><block type="kitronik_move_motor_horn" id="W-v~DE_~89;vmI]T4ZsL"><next><block type="variables_set" id="no:-K%$/W9izHx/09k;m"><field name="VAR" id="Ayg,B1jb;@or-EvfU/|6">driving</field><comment pinned="false" h="80" w="160">Drive!</comment><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="logic_boolean" id="Y]Rvb+fG~5MCwlTj;n6v"><field name="BOOL">TRUE</field></block></value><next><block type="device_while" id="b-F~f7Dc{3T/Xp1:Z$Cs"><value name="COND"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="variables_get" id="fat1U#TI9;AhF3bQa$f~"><field name="VAR" id="Ayg,B1jb;@or-EvfU/|6">driving</field></block></value><statement name="DO"><block type="variables_set" id="VllanV`IIl+O2V#[~Sv;"><field name="VAR" id=".OO![B(5.(Ys,y.{ah}-">rightSensor</field><comment pinned="false" h="80" w="160">Read sensors</comment><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="kitronik_move_motor_line_follower_read_sensor" id="KbF/=L5m_cvN8nQ?uTzc"><field name="pinSelected">Kitronik_Move_Motor.LfSensor.Left</field></block></value><next><block type="variables_set" id="L]yiYw*!0mWD[DPqeT.D"><field name="VAR" id="DXbYA~^hUnRA:u9HMbGU">leftSensor</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="kitronik_move_motor_line_follower_read_sensor" id="6-2v-fF=FBh[W;gr-AHH"><field name="pinSelected">Kitronik_Move_Motor.LfSensor.Right</field></block></value><next><block type="variables_set" id="B{a`G?L*ayw^5+lCKI.E"><field name="VAR" id="Bu19!nDGLfoK,e248j{_">sensorDifference</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_arithmetic" id="=lmS_`{w,NYkAfWsvm5w"><field name="OP">MINUS</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="~2+~@5%gkXa#ZqoJ1Irx"><field name="VAR" id="DXbYA~^hUnRA:u9HMbGU">leftSensor</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="p=rc;wTy;CEXKe$jy2`)"><field name="VAR" id=".OO![B(5.(Ys,y.{ah}-">rightSensor</field></block></value></block></value><next><block type="controls_if" id="6mf9Cjc?});X~c#6c=X0"><mutation elseif="1" else="1"></mutation><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="f,V(}!+q:UXQKL}rd#%U"><field name="OP">GT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="9zs9Cr23Y}r/tdx(?9(="><field name="VAR" id="Bu19!nDGLfoK,e248j{_">sensorDifference</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="8wJ0?xuW,-5%I+L/=z[@"><field name="VAR" id="9-b}(wF$C38(E?mB@T0`">sensorSensitivity</field></block></value></block></value><statement name="DO0"><block type="kitronik_move_motor_motor_off" id="j[zcMacNlWBZB+OAzSZU"><field name="motor">Kitronik_Move_Motor.Motors.MotorRight</field><comment pinned="false" h="80" w="160">We need to turn right</comment><next><block type="kitronik_move_motor_motor_on" id="x*`Rc!W}CtsJeCP8kDBn"><field name="motor">Kitronik_Move_Motor.Motors.MotorLeft</field><field name="dir">Kitronik_Move_Motor.MotorDirection.Forward</field><value name="speed"><shadow type="math_number_minmax"><mutation min="0" max="100"></mutation><field name="SLIDER">0</field></shadow><block type="variables_get" id="d!8e?T8*8aZWG1HMeH$M"><field name="VAR" id="1v*u:l#WBl$?BW!@5wKK">speed</field></block></value></block></next></block></statement><value name="IF1"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="iZ-nKAB,^GAT]caE^)-I"><field name="OP">LT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="l2@+vubb5a|O0N!Arr@;"><field name="VAR" id="Bu19!nDGLfoK,e248j{_">sensorDifference</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_arithmetic" id="_PxFO}qkc|r1hrgeRCAS"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="(I9H:D)U#!cwvSuH_|%#"><field name="NUM">0</field></shadow></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="d0Fx1j.=?zwZ=x((m;@X"><field name="VAR" id="9-b}(wF$C38(E?mB@T0`">sensorSensitivity</field></block></value></block></value></block></value><statement name="DO1"><block type="kitronik_move_motor_motor_off" id=";7ag6;t6^h]@6iNAXHhT"><field name="motor">Kitronik_Move_Motor.Motors.MotorLeft</field><comment pinned="false" h="80" w="160">We need to turn left</comment><next><block type="kitronik_move_motor_motor_on" id="m)_,WQ}:!,$`Fp_WMb1s"><field name="motor">Kitronik_Move_Motor.Motors.MotorRight</field><field name="dir">Kitronik_Move_Motor.MotorDirection.Forward</field><value name="speed"><shadow type="math_number_minmax"><mutation min="0" max="100"></mutation><field name="SLIDER">0</field></shadow><block type="variables_get" id="*pJIOd=GPXr*9c}.rC;U"><field name="VAR" id="1v*u:l#WBl$?BW!@5wKK">speed</field></block></value></block></next></block></statement><statement name="ELSE"><block type="kitronik_move_motor_drive" id="J).Jn7estrQ;drEs^eYA"><field name="direction">Kitronik_Move_Motor.DriveDirections.Forward</field><comment pinned="false" h="80" w="160">Hold the course</comment><value name="speed"><shadow type="math_number_minmax"><mutation min="0" max="100"></mutation><field name="SLIDER">0</field></shadow><block type="variables_get" id="ZFPnft)j%K0Qdt0!P((m"><field name="VAR" id="1v*u:l#WBl$?BW!@5wKK">speed</field></block></value></block></statement><next><block type="controls_if" id="f2[yMiz{j_yQGZFWXWi}"><comment pinned="false" h="80" w="160">Crash protection!</comment><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="LO83qnNzW@,H;{PZ@H3h"><field name="OP">LT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="kitronik_move_motor_ultrasonic_measure" id="9i~eHky1p3LPH~krtaED"></block></value><value name="B"><shadow type="math_number" id="2K?,)G}R5~Of$EECi.;K"><field name="NUM">15</field></shadow></value></block></value><statement name="DO0"><block type="kitronik_move_motor_stop" id="AzWpKlAvHoo]0xV)v;Bw"><next><block type="kitronik_move_motor_horn" id=";Sk3i9YpCulU!!QvTx6X"><next><block type="variables_set" id=")^v6{vrTJJVqtrt|z=q6"><field name="VAR" id="Ayg,B1jb;@or-EvfU/|6">driving</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="logic_boolean" id="t_$C](XCj_:}XO!VXpxP"><field name="BOOL">FALSE</field></block></value></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="device_button_event" id=";*G=tVI~GKK;@RNZ}?j}" x="774" y="-11"><field name="NAME">Button.B</field><statement name="HANDLER"><block type="kitronik_move_motor_stop" id="R+LauF}JdQiq{eDOXV`{"></block></statement></block></xml>