Chapter 1 – Introduction to Blockly with Zumis
1.3 – How to Express Your Feelings
This module helps students learn how to program Zumi’s lights, emotions and sounds.
Emotions
Zumi has a personality and can be used to express emotions through the OLED (organic LED) screen. Zumi has a variety of different “eye” expressions, including. Here are some of the blocks available in the `Screen` Menu:
We can also make Zumi draw text on her screen.
We can have Zumi greet you and then display happy eyes. We will add a `Wait` block to make the message stay on screen for a bit.
Sounds
Zumi can also play sounds to match her emotions. Sound can be measured in frequency and amplitude. Use the `play __ for ___ millseconds` block to play various notes. The first parameter is the note you want to play (anywhere from C2 to B6). The second parameter is optional and denotes the amount of time you want the note to play in milliseconds.
Here is an example of using Zumi’s screen to display text, emotions and also use her buzzer for sounds.
Lights
Zumi has headlights and brake lights that can be programmed using LEDs. Zumi has eight LEDs on the board, but only three on the left side indicate charging state, one on the right side indicates that the Pi started successfully and two on the front are for headlights. The back LEDs are much easier to see; they are the red ones on the back of Zumi. The following blocks are available to control Zumi’s LEDs:
Activity
Make Zumi use her right signal light whenever she turns right. Make sure you turn the light back off after making the turn.
`Hint`:
Turn the signal on first, go forward for 2 seconds, wait 2 seconds, turn right and then turn the signal off.
Conclusion
With the Zumi robot, we have learned how to program lights, emotions, and sounds. We can now create our own unique experiences with Zumi.
Demo
## Questions