10. First, go to the Input menu (light purple) and scroll down to the bottom
(Figure
O
)
. Then:
• Find the “on [loud] sound” block and drag it into the workspace.
• Notice that a little image of a microphone lights up on the simulated
board. This means you have turned on the sound sensor.
• Next to the light is the number 128, and below that is a scale that
looks like a thermometer. These show what sound level is being
detected by the sound sensor. The numbers go from 0 to 255, so
128 is in the middle. You will use these later to test the sound part of
your program.
11. To make the robot wait before it responds to a voice or sound:
• Go to the Basic menu (blue), and scroll down to find a “pause (ms)
[100]” block.
• Drag it into the “on [loud] sound” block.
• The length of the pause is measured in milliseconds (written as
“ms”). One thousand milliseconds equals 1 second
(Figure
P
)
.
To make the pause longer:
• Click on the arrow next to the “100” to open a menu.
O
142
Making Simple Robots, 2nd Edition
Make_Simple_Robots_interior_FIN.indd 142Make_Simple_Robots_interior_FIN.indd 142 4/26/22 1:56 PM4/26/22 1:56 PM