l 1xGrove - Speaker
l 1xGrove Shield for micro:bit
Thisdemo will teach you how to use the 2 micro:bit buttons to play music.
Add basic block on start, the add variableblock setitem to 0, rename “item” to “speaker” and replace “0” with pin block“digit read pin P0”
Add an input block for when button A is pressed, thespeaker play sound “middle C”at 1 beat.
3. Addan input block for when button B is pressed, the speaker play music “dadadum”once.
5. Pressbutton A or button B to play the sounds.