5

waiting, repeating, and other programming techniques

The previous chapter taught you how to program your robot to perform a variety of actions, such as moving. In this chapter, you’ll learn several programming techniques that will allow you to do more with the blocks you used earlier, including how to pause a program with Wait blocks, how to repeat a set of actions with Loop blocks, how to run multiple blocks simultaneously, and even how to make your own so-called My Blocks.

the wait block

So far you’ve been using three different programming blocks to make the robot move, play sounds, or display something on its screen. Now you’ll meet a block that does nothing more than pause the program for a given amount of time. This block is the Wait block ...

Get The LEGO MINDSTORMS NXT 2.0 Discovery Book 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.