synchronizing two sequence beams

You can control when a second Sequence Beam starts by choosing where to start drawing the Sequence Beam. In some programs, you may want to also make the task on one Sequence Beam pause until the task on the other Sequence Beam completes. The following are two ways to accomplish this.

the AroundTheBlock program

In the AroundTheBlock program (see Figure 17-2), you may want to stop updating the display after the TriBot has completed moving around the square. Instead of having the Loop block run forever, you can use a variable to control when the loop stops. Figure 17-13 shows a modified version of the AroundTheBlock program that uses a logic variable named Done to control the Loop block. The variable is set to false ...

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.