9 – Bigfoot, Bigger Brain

Parents: Make sure your device’s microphone is turned on. You may get a pop-up asking whether to allow the WeDo program to use the microphone; click “Yes” or “Allow” so that this chapter can work.

Wait, you’ve never seen a Bigfoot at the zoo? Not IN the zoo, I mean AT the zoo. One was waiting in line with me to buy snacks! They’re just as smart as we are so they don’t belong in cages. Here’s how to build our new friend:
Tip: Click the Gear icon to open settings, click “Playback Speed”, and select “0.5x” or “0.25x” to slow down the video so its easier to follow along!
Can you make bigfoot start moving when it hears a sound? Hints: use the microphone block and make sure your computer’s microphone is on. If you need a reminder, go back to the “Deep Sea Echoes” Dolphin chapter.
To prove that Bigfoot is smart, have it count every time something is in front of it. It will need to hold the distance sensor in its hand.
See the envelope? It remembers the value that’s on the computer screen and sends it to the second programming block, where you see the envelope arriving through the mail slot. The second program tells Bigfoot to stop and play a “finished” sound. It starts only when it gets a message that equals the number under it. That is the number you want Bigfoot to count to. Here I set it to 5. You set it to whatever you want.
Programmers call that a VARIABLE. They use these a lot! Think of video games you’ve played. The game remembers your health, your score, things you’ve picked up in the game, and lots of other things. The video game program puts those in VARIABLES.
Thank Bigfoot for telling you about VARIABLES!
Bigfoot is a programmer, in fact. Here’s the code they wrote. Read it and I think you’ll get it!
** This is the first line **
 

IF SOUND THEN DO:

     MOTOR.SPEED = 8
     MOTOR.DIRECTION = FORWARD
VARIABLE = 0

** This is the part under the loop **

DO UNTIL VARIABLE = 5:

     IF SENSOR.INPUT = CLOSE THEN DO:

          VARIABLE = VARIABLE + 1

          LIGHT.COLOR = 1

          MUSIC = 15

** This is the second line of blocks **

IF VARIABLE = 5:

     MOTOR.STOP

     MUSIC = 12

     END