microbit

micro:bit Project 2: Music Player

Difficulty Level

Level1

Part List:

l 1xGrove - Speaker

l 1xGrove Shield for micro:bit

l 1xmicro:bit

Description

Thisdemo will teach you how to use the 2 micro:bit buttons to play music.

Steps

1.      
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”

2.      
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.

 

4.      
Click Download andtransfer your code in your micro:bit!

5.      Pressbutton A or button B to play the sounds.

mollyAug 31,2017 14:23 PMAdd Comment

Comment

Popular Topics