Tuesday, November 2, 2010

Clap On Clap Off

1. 4%
2. 100%
3. 52%
4. wait for sound to go above threshold. wait for sound to drop below threshold. start motor. start motor. wait for sound to go above threshold. wait for sound to drop below threshold. stop motor, stop motor.
5.i) they are two wait blocks, one to wait for the sound to go above the threshold, the other to wait for it to go below the threshold.
ii) You need two because the program begins when it hears the clap, runs the motors, and moves immediately onto the next wait for block, but all of that happened so fast that by the time it gets to the second wait for block the sound for the first clap is still above the threshold so the program stops.
6. The threshold tells it how loud the sound has to be to meet the wait for block's requirements for the program to activate. If it was higher, you would have to create a louder sound to start the program. It it was lower, you would not have to make such a loud sound to start the program.
7. Because it is always above a quiet value, but it below the loudest possible value you could have, making the program easy to activate.
8. Yes, any sound that met the threshold value would activate the program, regardless if it was a clap or not.
9.i) Find the quiet value for the theater and find the loud sound for the door slamming. average the two together to find the threshold value to be used in the program we created.
ii)The sounds of the people in the theater (ex if they clap, cheer, or laugh) or the sounds of the actors might accidentally create a sound above the threshold value and set off the robot.
10. Write a program that says wait for the sound to reach a value that you determine it too loud. When it goes above this threshold value, turn the motor on to turn the light off. Wait for the sound to drop to the quiet value for the cafeteria and then activate the motor again to turn the lights back on.
11. After it runs, it will go back to the beginning to the program and start again with another loud sound. So after it stops, it will start again with another clap.
12. It will run infinitely until you turn the program itself off.

No comments:

Post a Comment