Skip to Main Content
The Art of LEGO MINDSTORMS NXT-G Programming
book

The Art of LEGO MINDSTORMS NXT-G Programming

by Terry Griffin
August 2010
Intermediate to advanced content levelIntermediate to advanced
288 pages
13h 21m
English
No Starch Press
Content preview from The Art of LEGO MINDSTORMS NXT-G Programming

Chapter 6. program flow

Program flow is all about controlling the order in which the blocks in your program are run. As you can imagine, controlling the order of your blocks is as important as setting their configuration. The parts of a programming language that control the program flow are often called programming structures, and NXT-G has three: the Sequence Beam, the Switch block, and the Loop block.

In this chapter, I’ll cover the Switch and Loop blocks in depth and show you how to use them effectively, filling in the details I glossed over in the previous chapters. A few other blocks are also used to control how your program runs. You have already seen the Wait block, and I’ll cover the Keep Alive and End blocks in this chapter.

Note

The information ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

Terry Griffin

Publisher Resources

ISBN: 9781593272180Errata