<!DOCTYPE aesl-source>
<network>
<event size="1" name="pair_run"/>
<event size="14" name="debug_log"/>
<node nodeId="{6527c87d-d28d-46b8-bc5e-affbd7988eb1}" name="Thymio-II Wireless"># reset outputs
call sound.system(-1)
call leds.top(0,0,0)
call leds.bottom.left(0,0,0)
call leds.bottom.right(0,0,0)
call leds.circle(0,0,0,0,0,0,0,0)

onevent prox
	when prox.ground.delta[0] &lt;= 400 and prox.ground.delta[1] &lt;= 400 do
		motor.left.target = 500
		motor.right.target = 500
		emit pair_run 0
		_emit debug_log [0, 0x2, 0x83, 0xa, 0x190, 0x1c2, 0x1414]
	end

	when prox.ground.delta[0] >= 450 and prox.ground.delta[1] &lt;= 400 do
		motor.left.target = 500
		motor.right.target = 0
		emit pair_run 1
		_emit debug_log [0x1, 0x2, 0x83, 0x6, 0x190, 0x1c2, 0x140a]
	end

	when prox.ground.delta[0] &lt;= 400 and prox.ground.delta[1] >= 450 do
		motor.left.target = 0
		motor.right.target = 500
		emit pair_run 2
		_emit debug_log [0x2, 0x2, 0x83, 0x9, 0x190, 0x1c2, 0xa14]
	end

	when prox.ground.delta[0] >= 450 and prox.ground.delta[1] >= 450 do
		motor.left.target = 0
		motor.right.target = 0
		call leds.top(32,0,0)
		call leds.bottom.left(32,0,0)
		call leds.bottom.right(32,0,0)
		emit pair_run 3
		_emit debug_log [0x3, 0x4, 0xa983, 0x5, 0x190, 0x1c2, 0xa0a, 0x8820, 0x8820]
	end

<toolsPlugins>
<ThymioVisualProgramming>
<vplroot xml-format-version="1">
<program advanced_mode="0">
<set>
<block value0="2" value2="400" value1="2" type="event" value3="450" name="proxground"/>
<block value0="500" value1="500" type="action" name="move"/>
</set>
<set>
<block value0="1" value2="400" value1="2" type="event" value3="450" name="proxground"/>
<block value0="500" value1="0" type="action" name="move"/>
</set>
<set>
<block value0="2" value2="400" value1="1" type="event" value3="450" name="proxground"/>
<block value0="0" value1="500" type="action" name="move"/>
</set>
<set>
<block value0="1" value2="400" value1="1" type="event" value3="450" name="proxground"/>
<block value0="0" value1="0" type="action" name="move"/>
<block value0="32" value2="0" value1="0" type="action" name="colortop"/>
<block value0="32" value2="0" value1="0" type="action" name="colorbottom"/>
</set>
<set/>
</program>
</vplroot>
</ThymioVisualProgramming>
</toolsPlugins>
</node>
</network>
