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

the logic block

Many of the programs presented so far make decisions using the program flow blocks, the sensor blocks, and the Compare block. These decisions involve a single condition, usually comparing the value from a sensor to a target value, with the result (either true or false) used in a Switch or Loop block. To put it another way, the programs are asking simple questions like “Is the Touch Sensor pressed?” or “Is the reading from the Light Sensor less than 50?”

The Logic block lets you combine multiple conditions, allowing your program to make more complex decisions. This lets your program ask questions like “Is the Touch Sensor pressed and the Light Sensor reading greater than 50?”

You can find the Logic block with the other math-related ...

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