displaying the tone frequency
To display the Tone Frequency value, you’ll use a Number to Text block to convert the value to text and then use a Display block to print the value. Figure 8-23 shows the SoundMachine program with the two new blocks added and the data wires connected.
Notice that the data wire supplying the input to the Number to Text block is connected to the Sound block instead of the Math block. The output side of the Tone Frequency data plug is called a pass-through data plug because it passes on the data supplied to the input side. Using the pass-through data plug from the Sound block is the same as adding a data wire from the Math block to the Number to Text block. The Sound block doesn’t change the data while passing it on; ...
Get The Art of LEGO MINDSTORMS NXT-G Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.