Sound
Lesson (25 mins):
Classroom Code / Project: Make a Song, Sense a Sound
Equipment: (1 for each Trainee)
Micro:bit
computer
USB cord
Skills
Use the microphone and the speaker
Keywords
events
In Game Application
Open-ended projects, stopping the shape shifter
Sound Output
The micro:bit has an on-board speaker that lets it make different sounds (all in various flavors of “beep” — it’s not a particularly complex speaker). It can play specific notes or even short songs.
Facilitator guides the students through “Make a Song” Project:
Sound Input - Loud / Soft Sounds
The micro:bit also had an on-board microphone that lets it sense how loud a sound is. At the most basic, you can tell it to use loud or soft sounds as an input (i.e., if the micro:bit senses a loud sound, it should do something).
Sound Input - Loud / Soft Sounds
The microphone can also be used to sense how loud a sound is.
This is really useful because you can use it to control something depending on the loudness — for instance, to create the impression of a karaoke robot that “sings” to the music, or to have lights pulse in time to a beat. — > Does this need a pause?? Check code!
Facilitator guides the students through “Sense a Sound” Project:
Open-Ended Exploration (if time permits)
Some ideas for inspiration:
Explore the other sound blocks — tempo, volume, etc.
Use the sound level to control a servo. Try attaching materials to the servo arm for different effects.
Plot the sound level as a bar graph on the LED strip.