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

conclusion

The Loop block can use data wires for both the loop count and the loop condition. Once you get used to the loop count starting at zero, it’s easy to use it to control the loop. The Timer1 program demonstrates how to use the loop condition to control when the loop finishes. The Timer2 program shows how to use the loop count and a Compare block to control how many times the loop repeats. Finally, the Timer3 program shows how to rearrange the blocks within the loop when you want the loop condition checked at the beginning of the loop. This is useful in situations where you may not want the loop body to be executed at all.

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