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

Chapter 14. math and logic

Working with numbers is an important part of many programs. In this chapter I’ll explain how NXT-G works with numbers in order to help you use the Math block successfully. I’ll also discuss how to use the Logic and Range blocks to expand the types of decisions your programs can make.

computer math

Computers have a well-deserved reputation for being very good at math. In NXT-G, the Math block is used to perform any calculation your program needs. This block is very easy to use; you simply select the operation to perform and provide the numbers to work with using either the Configuration Panel or data wires. Performing complex calculations is a simple matter of combining several Math blocks.

Although the Math block is easy ...

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