Go back to the Logic menu. From the Comparison section, drag the
“[0 = 0]” block with the pointy ends into the “true” space on the “if-
then” block
(Figure
Y
)
.
From the Variable menu (red), drag an oval-shaped block into the
first oval space on the Comparison block. Make sure it has the same
name as the variable you created before. Type the number 1 into the
other space
(Figure
Z
)
.
To choose a robot noise, open the Music menu (orange) and scroll
down to find the “play sound [giggle] until done” block. Drag it into
the mouth of the “if-then” block
(Figure
Aa
)
.
For numbers 2 and 3, repeat the same set-up using the “else” line
(Figure
Bb
)
:
To make the next “else”
line and mouth appear,
click on the plus sign
on the bottom of the
“forever” block.
Duplicate the pointy-
ended Comparison
block, insert it into the
next open mouth, and
type in the new number.
Duplicate the “play
sound” block and insert
it into the mouth.
To close the last mouth,
click on the minus sign.
Bb
Chapter 4: Making Robots Likable 147
Make_Simple_Robots_interior_FIN.indd 147Make_Simple_Robots_interior_FIN.indd 147 4/26/22 1:56 PM4/26/22 1:56 PM
14. Choose three different sounds for your three random numbers
(Figure
Cc
)
. If you want to hear what they sound like first, set up a quick stack of
blocks to test them out:
Go to Input (violet) and drag an “on button [A] pressed” block into
the workspace.
Duplicate a “play sound” block and insert it into the mouth of the
button block.
Click the arrow on the “play sound” block to show the drop-down
menu of different sounds. Then just pick a sound name and click on
the A button on the micro:bit simulation to hear what it sounds like.
15. When you’re finished, you will have an “if-then-else-else” stack of three
numbers and three sounds
(Figure
Dd
)
.
Dd
Cc
148
Making Simple Robots, 2nd Edition
Make_Simple_Robots_interior_FIN.indd 148Make_Simple_Robots_interior_FIN.indd 148 4/26/22 1:56 PM4/26/22 1:56 PM
GO BEYOND
Using conductive tape, give your soft robot some felt buttons that
respond to touch, and connect them to the micro:bit with alligator clip
wires. Look at the Guitar Touch Tunes project on the micro:bit site to
see how it works: microbit.org/projects/make-it-code-it/guitar-1-touch-
tunes. Also see my book Fabric and Fiber Inventions for other kinds of
sensors you can build from felt and conductive tape or thread.
The micro:bit doesn’t have a light sensor, but you can use its built-in
LEDs to detect light levels. Write a program that makes your robot blink
when you shine a light at it, or let out a startled squeak when a shadow
falls over it.
Turn your FiberBot into a chatbot by programming the micro:bit to
respond to questions with scrolling sentences on its LED grid. Use the
random command to make it display general yes/no answers when it
hears a sound. Or, for more advanced software engineers, there are
also some machine learning speech recognition programs that can run
on the micro:bit!
NOTE: You can see video of this project on my website at
kathyceceri.com/making-simple-robots.
Chapter 4: Making Robots Likable 149
Cover Page “i”
Preface Intro Chap 1
Xxxxxx Chap 3
Chap 3 Chap 5 Chapter 2
Make_Simple_Robots_interior_FIN.indd 149Make_Simple_Robots_interior_FIN.indd 149 4/26/22 1:56 PM4/26/22 1:56 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset