LEGO Engineering

| | | | | | | |
How do I create a loop in NXT-G so that I can repeat one sequence of events over and over?


20th of April, 2010

(6 )
100% thumbs up 0% thumbs down

Create a sequence of events that you would like to repeat, and then create a 'loop' from the loop function on the left side. Then drag that whole sequence of events into the loop, and the loop will repeat them!  By default, the loop is infinite, but you can adjust it if you click on the loop itself so that it will only loop a certain number of times, for a certain amount of time, or even until a sensor is activated. Below is an example of a car with touch sensors on the front and back which will go back and forth infinitely, changing direction when it runs into something (thus activating the touch sensor):



   :
   :
* :
* :
 


Home | About Us | Contact Us

© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.