Question 8: Robot ears: Go back to the instruction book and add the sound sensor. Now write a program to start the robot going in a straight line when you clap and then stop when you clap again. You may need to adjust the level that it takes for the robot to hear a clap to a higher value if you are in a noisy room. You want to add a wait before detecting the stop clap or you might start and stop on the same clap. The computer and sensor are very fast.
|
Problem 8 uses the new sound sensor. The sensor only detects volume levels, not actual words. Basically for the clap-on / clap-off program you want to wait for a loud sound then start your motors. Wait a short period so the sound that started the motors is over, then wait for another loud sound and turn off the motors. You could put it in a continuous loop to keep starting and stopping if you want. |
|
|