Use wires with alligator clips to connect headphones to the microbit:
Connections for headphones with a microphone.
If you connect the pin 0 wire (the red wire in the diagram) to the tip and the middle of the headphone plug, both speakers will go.
Here is a simple program using some of the music commands.
Follow these steps to make your own copy so you can modify it and download it:
Click the Edit button in the top right corner to open makecode editor.
In makecode editor, click the SHARE button.
Click PUBLISH PROJECT.
Click COPY to copy the link.
Open MAKECODE EDITOR in a separate link. Click IMPORT then IMPORT URL.
Press the CTRL and V keys to paste the link, then click GO AHEAD.
Create a new project called song.
Use the Music 'play tone' command to make up your own song e.g.:
Create a program called random tunes. Create a variable called tunenumber.
On shake, tunenumber is set to a random number between 1 and 3. The value of tunenumber is then displayed and the microbit plays one of three different melodies depending on if tunenumber equals 1, 2 or 3.
Create a program called tunes. Create a variable called tunenumber.
On start, tunenumber is set to 1.
When button B is pressed, tunenumber changes by 1. If tunenumber is greater than 5, it is reset to 1.
When button A is pressed, one of 5 different melodies is played depending on the value of tunenumber.
Show the value of tunenumber on the LED display.