Chapter 10. data wires and the loop block

In this chapter, you’ll learn how to use two special features of the Loop block that are designed to be used with data wires. The Loop block has two data plugs: The Loop Count data plug tells you how many times the loop has completed, and the Loop Condition data plug allows you to control when the Loop block finishes. I’ll begin with a few simple programs to demonstrate how these features work, and then I’ll show you how to use them to build three different programmable timers.

the loop count

The loop count tracks the number of times the loop body has been repeated. The data plug for the count isn’t displayed when you first add the Loop block to your program, but if you check the Show Counter box in the ...

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.