Setting up the loop

All of the code for the Omnilander is contained within an infinite loop, which makes the program repeat until the user presses the back button on the EV3 brick to exit the program and return to the menu. Recall that we did the same thing with the Security Tank; most of the programs we will make in this book will be contained within an infinite loop:

When you add the loop block into the program, it will be set to repeat infinitely by default. This is exactly what we want, so there is no need to change any of the settings. We are ready to move on!

Get Building Smart LEGO MINDSTORMS EV3 Robots now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.