In this activity, you will make all kinds of mechanical animals for the Robot Zoo. Warning: it's not your average zoo.
You should complete "Milo on Mars" first. If you did, then you're smart and independent, and you'll figure out all the zookeeper activities, even though there aren't as many hints and helpful tips in this activity. At the end, we will make an automatic feeder for your animals. It has some tricky programming. You can handle it.
If you forgot how to get connected, the instructions are activity #1 of Milo on Mars.
No build instructions ... you can build them to look any way you want. Here are some pictures to get you started. Share some pictures of your funny frogs.
One frog will make a sound when something gets close. The other will make a sound when it is moved. Hint: make sure the distance sensor is not covered up. It's OK to cover up the motion sensor (the one with the arrows).
There are pictures of TWO programs. Try them both. Hint: on the one with two start buttons, push them both. What's the difference?
Go to this link to make some dancing birds.
Program them to dance and stop and repeat however you like.
Here's a challenge: Can you change the wheels and gears so each bird spins at a different speed?
Go to this link to make a wuchabuggle.
Don't tell me you've never heard of a wuchabuggle or seen one in a zoo. But if you haven't, here's a video of one in the wild. Yes, they like silly piano music.
For the program, just make the motor turn as long and as fast as you want. Experiment with different speeds.
Go to this link to make a T-Rex.
Dino challenge: make a small dinosaur and build the motion sensor into it. Then make it activate T-Rex when the small dinosaur moves. Hint: use the wiggle setting on the motion sensor.
Please do not put the motion sensor on your little brother, cat, mother, neighbor, etc. We don't want anyone to get eaten.
Here's a hint for the program. Start by telling T-Rex to just wait, with the yellow wait block. Put the orange motion sensor tab under it and click it until the wiggle setting is showing.
Then put your motor blocks. You already know how to do that.
If you want it to repeat, put a loop over the whole thing.
Go to this link to make a silly gorilla.
It has some cool mechanics, too.
Here's a challenge: put some bananas on a stick so they activate the gorilla when they are close to it. Hint: build the distance sensor in with the bananas, then bring it close to the gorilla.
Your program will be similar to the T-Rex.
Go to this link to make a dolphin. It swims on land!
It has some complicated mechanics, too.
Dolphin challenge: Dolphins use sound and echoes to find things in the water. Activate your dolphin when you make a sound. Hint: there's a microphone block, and your computer's microphone will have to be turned on.
Can you also make it stop when it gets near to something? you'll have to put the distance sensor on the dolphin.
Go to this link to make a crawling caterpillar.
It has some complicated mechanics.
A few steps are missing from the video, so they're below.
Try to make a program that does like this code. If you get stuck, use the hint below.
MOTOR.POWER= 8
REPEAT FOREVER:
MOTOR.DIRECTION=BACKWARD
MOTOR.TIME = 2
MOTOR.DIRECTION=FORWARD
MOTOR.TIME = 2
Then try the challenge program and feed your caterpillar when it's hungry!
At about 1:15, it's hard to tell which pieces are needed. Here they are.
At 1:48, they forgot to show putting these two green pieces at the ends.
At 2:46, instead of the mount on the front, put the distance sensor. It looks like a good mouth, too, don't you think?
Put the sensor wire out the side and then over the top - not out the back - or it will get in the way.
At about minute 2:10, a step is missing. Be sure to use these small white pieces, not the longer ones.
Here is the first program, above.
The challenge program is below.
See the envelope at the end of the first line of blocks? It remembers the value that's on its tag, the number zero. It sends that number zero to all the other programming blocks, where you see the envelope arriving through the mail slot. The second line starts when it gets a message of the number zero. The last line does NOT start, because it only starts when it gets a message of the number 1.
When the second line finishes, it sends out a number 1. The last line starts gets that message. The number one matches its starting number, so it starts. At the end of that line, it sends a 0, and back we go to the second line, which starts when it gets a number zero.
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.
Here's what that looks like in code.
MOTOR.POWER= 8
DO 3 TIMES:
MOTOR.DIRECTION=BACKWARD
MOTOR.TIME = 2
MOTOR.DIRECTION=FORWARD
MOTOR.TIME = 2
VARIABLE = 0
DO FOREVER:
IF VARIABLE = 0 THEN DO:
SCREEN.PRINT "I'M HUNGRY"
WHILE SENSOR.INPUT IS NOT CLOSE:
WAIT
IF SENSOR.INPUT IS CLOSE:
SCREEN.PRINT "YUM!"
VARIABLE = 1
IF VARIABLE = 1 THEN DO 3 TIMES:
MOTOR.DIRECTION=BACKWARD
MOTOR.TIME = 2
MOTOR.DIRECTION=FORWARD
MOTOR.TIME = 2
VARIABLE = 0
Go to this link to make a swimming shark.
Shark challenge: Sharks are good at sensing vibrations when something moves in the water. Make a fish and build the motion sensor into it. Then make the shark swim fast when when the fish wiggles or slow when it doesn't sense the fish wiggling. Hint: use the wiggle setting on the motion sensor.
Go to this link to make a bigfoot.
And please don't tell me you've never seen bigfoot at the zoo. Not IN the zoo. AT the zoo. One was waiting in line with me to buy snacks. They're as intelligent as we are so they don't belong in cages. And they like lots of mustard on their hot dogs. Go figure.
Big challenge: 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.
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 starts only if that message is the number 5. You can 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 she or he 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
You have a lot of animals in the robot zoo. How are you going to keep them all fed??
Let's make a feeder, so the animals can get their own food. When they're hungry, they just pull the green lever on the front and the machine will give them their meal.
Don't forget the 4th pin sticking out from the long green piece.
Don't forget the 4th pin sticking out from the long green piece.
Put the pin in the first hole.
Don't worry that these two green pieces are floppy now.
Now we have a lever for the animals to pull, and the motion sensor will tell when it is tipped down.
Tip the motor back a little, then slip it in so the gear teeth and the track teeth connect.
Like this.
Add one peg here.
Connect the big brick to that peg and connect the motor and sensor.
Make robot animal food. Whatever you think would look delicious to a Lego animal.
It should be 2 Lego bumps by 2 Lego bumps.
Load the food into the feeder.
Write a program now. Every time the motion sensor is tipped, move the motor at speed 1 forward for 0.1 seconds. But limit it to 6 times, because then the food runs our and the motor jams.
Make another line of blocks that reverses the feeder so you can reload it. Move the motor at speed 5 for 1.4 seconds.
There's a solution here, but see if you can do it yourself without looking.
What if the animals pull the lever and eat all the food at once? You'll have a bunch of sick zoo animals. And lots of animal poop.
Add something to make sure the animals have to wait 30 seconds before pulling the lever again. No hints! You can figure it out.
We can make the feeder reverse itself for re-loading automatically using variables! Remember those envelopes with messages in them?
This program sends a message from the sensor which is either zero or nine when it is fully tipped.
None of the lines of blocks has zero for a starting number, so zero means "just wait."
If the lever is pulled, the variable is set to 9. The message of 9 starts the second line which advances the feeder.
That also subtracts one from the number on the screen. At the end of the second line, it sends the number on the screen to the variable.
When that number gets to 1, it reverses automatically!
This is pretty fancy stuff, so follow it through block by block and you'll be a real pro !
Walldyn can find its way around an obstacle. It looks like it's sniffing around for someone to eat. But I think it just wants a hot dog.