You are on page 1of 2

Worksheet: Clap On, Clap Off

Introduction to Mobile Robotics > Clap On, Clap Off


Follow the steps in the online directions, and answer the questions at the appropriate times.

Construct: Write Your Program

Observations:

1. Record the sound value for quiet. < 2. Record the sound value for loud. > 3. Record the threshold value you calculated.45 Contemplate

4. Write a brief description of what each block in your program does.

Block 1: Tells the robot to go forward on the first clap for port C. Block 2: Tells the robot to go forward on the first clap for port B. Block 3: Turns motor C forward. Block 4: Turns motor B forward. Block 5: Tells the robot to stop on the second clap for port C. Block 6: Tell the robot to stop on the second clap for port B. Block 7: Tells motor C to stop. Block 8: Tells motor B to stop. 5. Define the Wait for Clap behaviour you built in the program.

i.

What are the two blocks that make up the behaviour? It waits for silence before it registers the next clap. Why isnt a single Wait For Sound block good enough? Because the clap resonance is louder than the threshold.

ii.

6. What does the threshold for the sound sensor do? What would happen if you set the threshold higher? Lower? You would need a louder/less noisy clap to start/stop the robot. 7. Why did you use a value from the sound sensor that was halfway between silence and clapping for your threshold value? Because the loudest clap we could do was 90 and we halved it top get 45 which was too quite so we changed the threshold to 60 so it would run properly. 8. Does your robot only respond to claps, or do other sounds trigger starting and stopping as well? Why do you think this is? Yes other sounds can trigger it. If the sound is the sound is louder than the threshold to start/stop the robot. 9. Marisa is using the robot as an actor in a class play. She wants the robot to start running across the stage on cue. The cue will be the sound of a door slamming as another (human) actor goes offstage. i. How should she go about programming her robot to recognize the correct sound and begin its performance at the right time? Be specific. Slamming a door is pretty loud so the threshold should be quite high so nothing else will trigger it. What possible problems might there be with this plan? Someone else makes a loud noise at the wrong time and triggers the robot to run across the stage.

ii.

Continue
Answer the following:

10. How did the loop change the robots behaviour? It changed the robots behaviour by making it go however many times you want it too before stopping it by clicking the button. It just kept going with a loud sound. 11. How many times will the loop run? The loop runs however amount of times you want it to with a loud sound to stop/start the robot.

You might also like