... | ... | @@ -191,7 +191,9 @@ |
|
|
>
|
|
|
> The dataLogger revealed the sound profile of a clap (see graph). With this in mind we made a program for the robot.
|
|
|
> The program ClapCar.java is familiar with the clap sound profile and once a clap is detected the robot will play a
|
|
|
> sound (see video).
|
|
|
> sound (see video).
|
|
|
>
|
|
|
> [![image alt text](http://img.youtube.com/vi/UMSrPEmQrwE/0.jpg)](http://www.youtube.com/watch?v=UMSrPEmQrwE)
|
|
|
>
|
|
|
>```
|
|
|
> while (!Button.ESCAPE.isDown()) {
|
... | ... | @@ -219,9 +221,13 @@ |
|
|
> Thread.sleep(5);
|
|
|
> }
|
|
|
>```
|
|
|
> Fig. ??: Inner loop of the ClapCar program.
|
|
|
>
|
|
|
> ![G3](http://gitlab.au.dk/uploads/group-22/lego/8b5ba5b544/G3.png)
|
|
|
> Fig. ??: Graph showing the profile of a single clap of sound level over time.
|
|
|
>
|
|
|
> We noticed that it is possible to trick the robot into thinking it hears a clap by shouting a short word to the sound sensor. This is due to the fact that the robot only distinguishes between volume and duration of a sound meaning that different sounds can actually result in the same sound profile. The graph below [fig. ??] shows a series of claps showing three distinct peaks. Each peak is a registered clap. The smaller peaks will not result in a beep as the sound profile does not match that of a clap.
|
|
|
>
|
|
|
> [![image alt text](http://img.youtube.com/vi/UMSrPEmQrwE/0.jpg)](http://www.youtube.com/watch?v=UMSrPEmQrwE)
|
|
|
>
|
|
|
> ---
|
|
|
> ## Exercise 6 - Party Finder Robot
|
|
|
>
|
... | ... | |