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 ...

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.