... | ... | @@ -23,3 +23,15 @@ |
|
|
#### Task
|
|
|
Vehicle 1. Use a sound sensor to implement a vehicle that moves faster forward the louder the environment sound is.
|
|
|
|
|
|
#### Plan
|
|
|
To use two motors to drive the vehicle and apply the same sound value as the power to the two motors in order to make the robot accelerate towards the sound.
|
|
|
|
|
|
#### Results
|
|
|
|
|
|
We started by equipping the robot with a sound sensor as seen in the picture below:
|
|
|
|
|
|
![fig1](http://gitlab.au.dk/uploads/group-22/lego/e8e60b9d15/fig1.jpg)
|
|
|
##### Fig. 1 - robot with microphone
|
|
|
|
|
|
Then we configured a SoundVehicle.java class which reads values from the sound sensor and maps the value to both motors on the robot. The code snippet[x] below shows how the program reads the sound value and maps it to the motors:
|
|
|
![fig1](http://gitlab.au.dk/uploads/group-22/lego/e8e60b9d15/fig1.jpg) |
|
|
\ No newline at end of file |