... | ... | @@ -57,15 +57,17 @@ Next, we modified our program to receive raw values directly from the sensor por |
|
|
|
|
|
[TODO: Perhaps insert code example?]
|
|
|
|
|
|
[TODO: Video, one from corner to middle in 3 bursts (Nicolai knows wtf this means)]
|
|
|
[![Raw value SoundLover](http://img.youtube.com/vi/I5IMfdiapT4/0.jpg)](https://www.youtube.com/watch?v=I5IMfdiapT4)
|
|
|
|
|
|
*Video 3: Running SoundLover.java using raw values read directly from the sensor port instead of dB values read from the sound sensor*
|
|
|
|
|
|
The next task was to map the raw values to the range [-100, 100], in order for the robot motor power range to go from full power backwards to full power forwards, rather than from full stop to full power forwards. We do this simply by multiplying the percentage of measured raw value (inverted) by 2 - that is, instead of obtaining a percentage value by multiplying by 100, we multiply by the full range value of 200. The resulting value is then added to the minimum range value of -100. We implemented this in the program ***SoundReactor.java***, and the result can be seen in Video 4.
|
|
|
|
|
|
[TODO: Insert videooo (killed the radio star) - Ida: Thank you, Nicolai, nu har man den på hjernen (min venindes kommentar: Thanks Obama)]
|
|
|
[![SoundReactor](http://img.youtube.com/vi/doQHtfXyvQ0/0.jpg)](https://www.youtube.com/watch?v=doQHtfXyvQ0)
|
|
|
|
|
|
*Video 4: The robot running SoundReactor.java*
|
|
|
|
|
|
After being thoroughly confused by draw int for a while (TODO: Ida forstår ikke det her - det var da ikke DrawInt, der forvirrede os?), we managed to get it working. As can be seen in the video, the robot drives forward and backward according to sound level reasonably appropriately, although it appears that when driving backwards the noise/vibrations caused by the robot is enough of an increase in the values picked up by the sensor that the robot immediately slows down its backwards driving and even drives forward a bit.
|
|
|
After being thoroughly confused by draw int for a while (TODO: Ida forstår ikke det her - det var da ikke DrawInt, der forvirrede os? Nicolai: Jo, det var hvor vi troede den viste 300-600 hvor den kun burder vise værdier fra 0-100, men det var bare fordi vi ikke clearet displayet så det 3. digit stadig var der fra de gange den viste 100), we managed to get it working. As can be seen in the video, the robot drives forward and backward according to sound level reasonably appropriately, although it appears that when driving backwards the noise/vibrations caused by the robot is enough of an increase in the values picked up by the sensor that the robot immediately slows down its backwards driving and even drives forward a bit.
|
|
|
|
|
|
We wrote a program, ***SoundHater.java***, as the inhibitory version of ***SoundLover.java***. The program is exactly the same as the SoundLover program, except we don't invert the read value. The result is shown in Video 5. The robot accurately stops when hearing loud noises and drives forward under low sound levels.
|
|
|
|
... | ... | |