Control remoto
El siguiente código te permite controlar tu robot, utilizando un control remoto estándar RC5 :
onevent rc5
if rc5.command == 2 then
motor.left.target = 300
motor.right.target = 300
elseif rc5.command == 8 then
motor.left.target = -300
motor.right.target = -300
elseif rc5.command == 4 then
motor.left.target = -300
motor.right.target = 300
elseif rc5.command == 6 then
motor.left.target = 300
motor.right.target = -300
else
motor.left.target = 0
motor.right.target = 0
end