Project 9: Speaker

Click to download the code for this lesson

(1)Project Description:

The Micro: Bit main board V2 has an built- in speaker, which makes adding sound to the programs easier. We can program the speaker to air all kinds of tones, like playing the son Ode to Joy.

(2)Components Needed:

Micro:bit main board V2

Micro USB cable

(3)Test Code :

Link computer with micro:bit board by micro USB cable, and program in MakeCode editor,

Complete Program :

(4)Test Results:

After uploading the test code to micro:bit main board V2 and powering the board via the USB cable, the speaker utters sound and the LED dot matrix shows the logo of music.