On clicking START, the Wait block will wait for input of sound from the "sound sensor" (computer mike). On hearing sound, the next block turn the motor this way (clockwise) and following block set the motor to turn 3 seconds. The final WAIT 2 seconds block have to be added in to force an interval before the program loop back to the START to repeat. If this is not added, the sound of the motor turning itself will then trigger to motor to move again and the program will go through continuous looping without waiting for the intended sound to start.
See video below. Also see how we can use this to have a Sound controlled car which moves on a sound command eg. clap hands.
Application: Sound controlled car
There is an earlier post about Building computer controlled car. All we need to do to have a sound controlled car is to connect the motor shown below to the computer and setup the above program to make the car move on sound command such as clap of the hands:
Connect motor to computer plus above program to make car move on sound input |
No comments:
Post a Comment