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

Using a data wire to supply the input to a Switch block gives you a lot of flexibility in the types of decisions your programs can make. Using a Sensor block, you can perform the comparison outside the Switch block, allowing you to make more complex decisions than the Switch block alone supports.

Using a number or text value as input, you can have the Switch block choose from more than two possible alternatives. Passing data between the blocks within the Switch block and those before or after allows you to easily customize each alternative action or make decisions that affect the rest of the program.

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