This lab involved the creation of programs that allowed out bot to display or output the audio sensor data value on the LCD display, respond to claps or loud noises to trigger the bot to make specific movements.
In this lab, we set out to develop and build a bot that that accepts a starting command (clap or other sharp sound) and plays music or sounds. The Bot will also be controlled by the Touch sensor.
Here we designed a program that repeatedly outputs (to the LCD) the Audio Sensor data value. We set the LCD to display “Sound Level:” on the first line. On the second line in the middle, the LCD was set display “Quiet” 0dBs to 33dBs, “Noisy” 34dBs to 66dBs, and “Loud” 67dBs to 100dBs. This task was completed by ensuring that the sound gauge was correctly configured to our desired thresholds for noise.
Here we designed a program that allows the Bot, upon hearing a clap, to drive forward for 5-seconds and turn around (180-degrees) and return very close to its original spot and stop. We then designed it to then turn 180-degrees, to face the same direction it did when it started, and be ready to accept another clap to repeat the process. We used part of our code from DriveBot to perform the driving, but fresh code was written to analyse the input sound level and make a decision on whether or not it should begin driving.
We used the NXT sound sensor and mounted it onto our robot. We did it in the following way:
We designed a program that allowed our Bot, upon hearing a clap (loud noise), to drive forward until the Bot bumps into something (Touch sensor is pushed) at any angle, stops (motors off), plays a sound, backs up enough to turn around, stops, turns around 15 degrees plus some random amount, and continues to drive forward until it bumps into something else.
The tasks were both successful as we managed to complete the programming and the fitting of the required parts to the robot.
Using the NXT software, we managed was able to recognize our threshold of noise levels according to our desired specification for each noise level. The program successfully recognize the noise level as “Quiet” when the noise was between 0dBs and 33dBs, “Noisy” when the noise level was between 34dBs to 66dBs, and “Loud” when the noise level was between 67dBs to 100dBs
Here we managed to attach the NXT sound sensor to the robot as shown in the figures in task 2. We task was successful with the robot being able to recognize clap sounds that triggered it to start. Upon hearing a clap, the bot drove forward for 5-seconds and turned around (180-degrees) and returned very close to its original spot and stop.
Here we succeeded in designing a program that allowed our Bot, upon hearing a clap (loud noise), to drive forward until the Bot bumped into something (Touch sensor is pushed) at any angle, stopped (motored off), played a sound, backed up enough to turn around, stopped, turned around 15 degrees plus some random amount, and continued to drive forward until it bumped into something else.
The lesson that we took from this lab report is that debugging of the programs that we developed consumed the most amount of time. Here is where we encountered some minor glitches that forced us to repeat the debugging process severally.