> Fig. Recording of a sequence of four finger snaps. The graph shows data logged from the NXT while running the
> SoundSampler program.
> ##### Fig. 4 Recording of a sequence of four finger snaps. The graph shows data logged from the NXT while running
> the SoundSampler program.
>
> The graph shows four distinct spikes in the sound level caused by the finger snapping. The spikes peak at 30-50
> (db?) before the sound level goes back to its normal. The background noise measured is about 2-10 (db?).It is
...
...
@@ -132,6 +134,7 @@
> and on the fourth it would stop.
>
> [](http://www.youtube.com/watch?v=wlh4UXzuPlk)
> ##### Fig. 5: Video of the clap controlled robot in action.
>
> As every word has its own sound profile It could be interesting to investigate if the robot could interpret and act
> differently on various voice commands. For instance it might be possible for the robot to recognize the difference
...
...
@@ -146,11 +149,11 @@
> used to stop the program. This does not work when the program loops in one of the four inner loops. You can make
> the ESCAPE button always work as a program terminator if you also poll the state of the button in the inner loops.
> But you can also use the ButtonListener mechanism to listen for the ESCAPE button and exit when ESCAPE is pressed.
> A simple example of a ButtonListener can be seen in the leJos tutorial, [4]. Try this in the program.
> A simple example of a ButtonListener can be seen in the leJos tutorial, [ref. 6]. Try this in the program.
>
> #### Plan
>
> To implement the ButtonListener from [4] of the Lab Lesson 3 guide.
> To implement the ButtonListener from [3] of the Lab Lesson 3 guide.
>
> #### Result
>
...
...
@@ -169,7 +172,9 @@
> }
> });
> ```
> In order to make the program terminate we use the S
> In order to make the program terminate we use the System.exit(int code) method with the int code being 0. At first we did not know what the ‘int code’ does, and the API gives no answer. We solved the problem by looking at other code examples on the web [4] and found out that we should use the value ‘0’.
This will make the program terminate no matter where in the loops it is running.