Make the robot play songs and create sound effects!
How Hz (vibrations) create different musical notes
How speakers work by vibrating to make sound
Note names (C, D, E) and their relationships
Using beats and pauses to create melodies
The micro:bit has a tiny built-in speaker! On the V2 version, it's on the back near the logo. It's a small piezo buzzer that can play tones and simple melodies.
In MakeCode, look in the Music category. Drag out a "play tone" block:
Upload it and press the reset button on the micro:bit. You should hear a single note!
Let's play a familiar tune—"Twinkle Twinkle Little Star"! Here are the notes:
MakeCode has pre-programmed songs! Try the "play melody" block:
Explore the melody dropdown—there's "Birthday", "Power Up", "Jump Up", and more!
Make the robot "talk" using frequencies! Here are fun effects:
Make the robot play music WHILE it drives! This is multitasking:
The "In Background" option lets music play while other code runs!
Hz means "vibrations per second." When you play 440Hz, the speaker vibrates 440 times every second. Your ear hears this as the note "A". Higher numbers = higher pitch!
Fun Fact: Dogs can hear up to 45,000 Hz! Try playing super high notes (above 15,000 Hz) and see if your pets react—you might not hear anything, but they will! 🐕
The micro:bit sends electrical pulses to the piezo buzzer. When you ask for 440Hz, it switches the buzzer on and off 440 times per second. This rapid vibration pushes air molecules, creating sound waves that travel to your ears!
Real-World Connection: Synthesizers, smartphones, and computer speakers all work this way. Music production software uses frequencies and waveforms to create everything from piano sounds to electronic beats! 🎧🎹
Button A = one note, B = another. Shake = random note. Make it a musical instrument!
Forward = engine revving (rising tone), Stop = brake screech (descending), Reverse = beeping
Compose your own song! Write out the notes on paper first, then program it.
Create a coin collection sound, jump sound, level complete fanfare!
Fantastic! The boys now understand sound waves, frequencies, and musical notation. They've learned how computers generate audio—the same principles behind music production and sound design!
Keep jamming: Can they recreate their favorite video game theme song? Or design alarm sounds for different robot "moods"?
Next Mission: Line Follower 🛤️ →