Knowledgebase Home | Contact Knowledgebase Home | Contact
Search the Knowledgebase Browse by Category
How do I create a loop in NXT-G so that I can repeat one sequence of events over and over?
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):



Visitor Comments
No visitor comments posted. Post a comment
Related Questions
No related questions were found.
Attachments
No attachments were found.

Powered by ActiveKB Knowledgebase Software