jessvi created page: Lab3 authored by Jesper Kurtzmann Svith's avatar Jesper Kurtzmann Svith
...@@ -11,25 +11,24 @@ ...@@ -11,25 +11,24 @@
> >
>#### Activity duration: 3+6 >#### Activity duration: 3+6
> >
>**Overall goal** >#### Overall goal
> >
>**Overall plan** >#### Overall plan
> >
> # Exercise 1 > # Exercise 1
> >
> **Task** > #### Task
> >
> To mount the sound sensor and run a test using a modified version of SonicSensorTest.java. Test the sensor with > To mount the sound sensor and run a test using a modified version of SonicSensorTest.java. Test the sensor with
> different loudness and under different circumstances and describe the readings. > different loudness and under different circumstances and describe the readings.
> >
> **Plan** > #### Plan
> >
> We made a program similar to the SonicSensorTest called SoundSensorTest, but changed it to use the sound sensor and > get the readings using the readValue() method of the SoundSensor class. > We made a program similar to the SonicSensorTest called SoundSensorTest, but changed it to use the sound sensor and > get the readings using the readValue() method of the SoundSensor class.
> >
>``` >```
>public class SoundSensorTest >public class SoundSensorTest
>{ >{
>
> public static void main(String [] args) > public static void main(String [] args)
> throws Exception > throws Exception
> { > {
...@@ -44,7 +43,6 @@ ...@@ -44,7 +43,6 @@
> while (! Button.ESCAPE.isDown()) > while (! Button.ESCAPE.isDown())
> { > {
> LCD.drawInt(SS.readValue(), 3, 13, 2); > LCD.drawInt(SS.readValue(), 3, 13, 2);
>
> Thread.sleep(300); > Thread.sleep(300);
> } > }
> LCD.clear(); > LCD.clear();
...@@ -55,13 +53,13 @@ ...@@ -55,13 +53,13 @@
> >
>``` >```
> >
>**Results** >#### Results
> >
>First we clapped at different distances to the sensor in order to measure from how far the sensor Will pick up >sound. We soon realized that the measurements were very inconsistent as it is impossible to make two or more >identical claps in a row. >First we clapped at different distances to the sensor in order to measure from how far the sensor Will pick up >sound. We soon realized that the measurements were very inconsistent as it is impossible to make two or more >identical claps in a row.
> >
>To compensate for the inconsistency we decided to use a smartphone and transmit a constant tone. The setup is showed >in the picture below. The car was placed on a table in the middle of the room and loudness were measured from >different distances: >To compensate for the inconsistency we decided to use a smartphone and transmit a constant tone. The setup is showed >in the picture below. The car was placed on a table in the middle of the room and loudness were measured from >different distances:
> >
>![Skærmbillede 2015-03-02 kl. 09.56.58](http://gitlab.au.dk/uploads/group-22/lego/fcb16f422c/Sk%C3%A6rmbillede_2015->03-02_kl._09.56.58.png) > ![Skærmbillede 2015-03-02 kl. 09.56.58](http://gitlab.au.dk/uploads/group->22/lego/fcb16f422c/Sk%C3%A6rmbillede_2015->03-02_kl._09.56.58.png)
> >
>Fig. 1: Picture of the setup. The robot was placed on a table and the phone was pointed towards the robot. After >each sensor reading the distance to the phone was increased. >Fig. 1: Picture of the setup. The robot was placed on a table and the phone was pointed towards the robot. After >each sensor reading the distance to the phone was increased.
> >
...@@ -74,19 +72,19 @@ ...@@ -74,19 +72,19 @@
>| 3 | 15-20 | >| 3 | 15-20 |
>| 4 | 9-11 | >| 4 | 9-11 |
> >
>**Skriv noget tekst her om tabellen!** >#### Skriv noget tekst her om tabellen!
> >
># Exercise 2 ># Exercise 2
> >
>**Task** >#### Task
> >
>To use the datalogger to record data from the sound sensor. >To use the datalogger to record data from the sound sensor.
> >
>**Plan** >#### Plan
> >
>We use the program DataLogger.java from lesson 1 to record data from the program SoundSampler.java. Then we will >process the data and make a graph using excel. >We use the program DataLogger.java from lesson 1 to record data from the program SoundSampler.java. Then we will >process the data and make a graph using excel.
> >
>**Result** >#### Result
> >
>The DataLogger was used to log data from the sound sensor. The experiment consisted of a period of 10 seconds in >which consecutive snaps were made with the fingers. The graph below shows the results: >The DataLogger was used to log data from the sound sensor. The experiment consisted of a period of 10 seconds in >which consecutive snaps were made with the fingers. The graph below shows the results:
> >
...@@ -101,11 +99,11 @@ ...@@ -101,11 +99,11 @@
># Exercise 3 - sound controlled car ># Exercise 3 - sound controlled car
> >
>**Task** >#### Task
> >
>Use the program SoundCtrCar.java to control the car using sound commands. >Use the program SoundCtrCar.java to control the car using sound commands.
> >
>**Plan** >#### Plan
> >
>To run the program and observe how the robot responds to different sound input. >To run the program and observe how the robot responds to different sound input.
> >
... ...
......