If you want to, you can also do “screen down,” but you’d have to hold the
FiberBot over your head to see it! (Where should the eye be if the screen
points straight down?)
7. At this point, the googly eye motion is complete! Before moving onto
some sillier animated moves, stop and download the code to your
micro:bit to watch how it works on the real thing! See the “How to
Download MakeCode to the micro:bit” box on page 139 for instructions.
You can work with the micro:bit right on the FiberBot. If the masking
tape loses its grip, just replace it when you’re done.
8. Just for fun, create another stack of code that makes the googly eye
roll around when you shake the robot. To do that, you’ll stack a series of
“show leds” blocks. When the program runs, the blocks will act like the
frames of an animated film — as they appear one after the other, it will
look like the eye is moving! Here’s what to do:
• Duplicate the “on [screen up]” block again, with the “show leds”
block that displays the eye in the middle of the grid. This time,
change the movement back to “shake”
(Figure
I
).
• Now duplicate just the “show leds” block. Drag the duplicate right
below the first block, inside the mouth of the “on [shake]” block.
The mouth will open wider as you add more blocks. Change the
lights on the second block to show the eye at the bottom of the grid
(Figure
J
)
.
I J
138
Making Simple Robots, 2nd Edition
Make_Simple_Robots_interior_FIN.indd 138Make_Simple_Robots_interior_FIN.indd 138 4/26/22 1:56 PM4/26/22 1:56 PM