BumperBot with sound

In this section, you’ll create the BumperBotWithSound program by modifying the BumperBot program so that the TriBot waits for you to clap before it starts moving.

To make the program wait for you to clap, you need to add a Wait Sound block before the Loop block. When you drag the new block to the left of the Loop block, the Loop block will shift to the right to make room, as shown in Figure 5-16. It takes some practice to get used to the way the IDE shifts the program around as you are dragging a block. Be sure not to move the block too fast and to pause for a second before dropping the block to make sure you have it in the right spot.

Figure 5-16. Inserting the Wait Sound block

Even after you have been doing this for a while, ...

Get The Art of LEGO MINDSTORMS NXT-G Programming 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.