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

adding labels to the displayed values

The previous version of the SoundMachine converted the Tone Frequency value to text and displayed the value. You can improve on this by using a Text block to add more information: Instead of just displaying a number, you’ll display a label and the unit for the value. The unit used to measure frequency is hertz (meaning cycles per second), abbreviated as Hz. Instead of displaying 2500, the program will display Tone: 2500 Hz.

Figure 8-32 and Figure 8-33 show the changes to the program and the Configuration Panel for the Text block. The Tone Frequency value is passed into the Text block as the B value, and the Configuration Panel is used to set the label and unit text. Although you can’t see it in the Configuration ...

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