Activities/Butialo: Difference between revisions
Tonyforster (talk | contribs) |
Tonyforster (talk | contribs) |
||
| Line 44: | Line 44: | ||
while true do | while true do | ||
print ("Presione el botón para comenzar") | |||
repeat until Boton.getBoton()==1 | |||
eq = Dist.getDistancia() | |||
print("Arrancando", eq) | |||
util.wait(1) | |||
repeat | |||
d = Dist.getDistancia() | |||
v = 100+5*math.abs(d-eq) | |||
if v > 1024 then v = 1024 end | |||
if d < eq then | |||
Motores.setvel2mtr(1, v, 1, v) | |||
else | |||
Motores.setvel2mtr(0, v, 0, v) | |||
end | |||
until Boton.getBoton()==1 | |||
print("Fin") | |||
Motores.setvel2mtr(1, 0, 1, 0) | |||
util.wait(1) | |||
end | end | ||
==Continue reading in Spanish== | ==Continue reading in Spanish== | ||
[http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php/Butialo] | [http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php/Butialo] | ||