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

using numbers with the NXT-G 2.0 switch block

One of the major differences between NXT-G 1.1 and NXT-G 2.0 is the change from using only whole numbers to using floating-point numbers, and this affects how the Switch block works. Even though NXT-G 2.0 supports floating-point numbers, you can use only whole numbers for the items in the Conditions list. The Switch block will round the value on the input data wire to the nearest whole number before comparing it with the list of values. For example, using the values shown earlier in Figure 9-16 (10, 75, and 125), any value greater than or equal to 74.5 and less than 75.5 will be rounded to 75 and so ...

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