Connect the Speaker to the micro:bit as shown below. When attaching the alligator clips to the micro:bit, make sure that the clips are perpendicular to the board so that they are not touching any of the neighbouring connectors on the micro:bit edge connector.
The quickest way to try out your speaker is to DOWNLOAD THIS HEX FILE and then copy it onto your micro:bit. Press Button A to hear a tune being played.
Visit the Blocks Editor in your browser and then from the input section add an on button A pressed block then from the music section add a start melody block and select the tune you want to play (in this case, entertainer).
Click Download and then copy the file onto your micro:bit.
You can also make a simple musical instrument, using this tutorial: https://makecode.microbit.org/projects/hack-your-headphones/code
Paste the following code into the Python window and then Download the file and copy it onto your your micro:bit
from microbit import * import music while True: if button_a.was_pressed(): music.play(music.ENTERTAINER)
When you press button A you will hear the tune “The Entertainer” play through the speaker.
As well as this board, we also have a Relay for micro:bit and a Sensor for micro:bit. We also have an Electronics Starter Kit for micro:bit that includes all three boards, a project booklet and other useful components to build yourself some great micro:bit projects.