Presentation is loading. Please wait.

Presentation is loading. Please wait.

BBC Microbit.

Similar presentations


Presentation on theme: "BBC Microbit."— Presentation transcript:

1 BBC Microbit

2 Objective of the lesson
Use Block Editor to make a Beatbox All of you will: Make Pin 0 produce a beating sound Most of you will: Make a button control the tempo Some of you will: Use light to control the beatbox

3 Beatbox We will use the Pins on the Microbit to make a sound when we touch them Add an ‘on P0 pressed’ block Add a ‘while True’ block so that the code will continue to play (once the P0 pin is pressed the condition stays true)

4 Add in a note a beat length and a pause between notes
Add an on button A pressed and change the tempo

5 Challenge Can you program P1 and P2 to play different notes Can you program button B to slow down the temp

6 Using light to control the music
Add an ‘on buttonA pressed do’ loop Add a variable and call it sound. Set this variable to equal the ‘light level’

7 Add an ‘if do’ loop. Make it so that if the light level is less than 25
Make it then play a ring tone C

8 Challenge Add in ‘else if’ statements and make it so that if the light variable is less than 50, it plays note D Carry on so that if the light variable is less than 100, it plays note E; if the light variable is less than 150, it plays note F; if the light variable is less than 180, it plays note G; else it plays note A. Changing the light level should now make the microbit play a tune

9 Answers

10


Download ppt "BBC Microbit."

Similar presentations


Ads by Google