Changes

Jump to navigation Jump to search
360 bytes added ,  19:46, 30 September 2012
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()
2,486

edits

Navigation menu