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 the number to text block

For the next part of the SoundMachine program, you’ll display the Tone Frequency and Volume values on the NXT’s screen. Displaying the values your program uses can be a big help when debugging. There is one small complication: The Tone Frequency and Volume values are numbers, and the Display block can print only text values.

To print a number, you first need to convert the number to text using the Number to Text block (in the Advanced group at the bottom of the Complete Palette, as shown in Figure 8-20 and Figure 8-21). The Number to Text block takes a number as input and outputs the equivalent text data. The input value is usually supplied using a data wire, although it can be set in the Configuration Panel (Figure 8-22 ...

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