Activities/Butialo: Difference between revisions

Tonyforster (talk | contribs)
Created page with "Butialo is a user-friendly environment that allows programming of the Butiá in the Lua language. Lua is a simple imperative scripting language but can create sophisticated p..."
 
Tonyforster (talk | contribs)
Line 21: Line 21:
   end
   end
  end
  end
Can also be programmed with events. The previous program is equivalent to the following:
local function adelante()
  Motores.setvel2mtr( 1, 500, 1, 500 )
end
local function esperar()
  Motores.setvel2mtr( 1, 0, 1, 0 )
  wait( 1 )
end
events.add( Dist.getDistancia, '<', 700, esperar )
events.add( Dist.getDistancia, '>', 700, adelante )
events.go()