micro:bit Tinker Kit Project 01 – Music Machine
What you will learn
- Get to know the ADKeypad and understand how it works
- Make something with the ADKeypad
- Make something with the Buzzer
What you need
- 1 x BBC micro:bit board
- 1 x Micro USB cable
- 1 x Octopus:bit breakout board
- 1 x Octopus passive buzzer
- 1 x Octopus ADKeypad
How to assemble
After connecting one end of the USB cable to your computer, connect the other end to the micro:bit as shown in the picture below. Then connect the side of the micro:bit where the pins are located to the breakout board.
Plug in the Octopus buzzer module to Pin 0. Plug in the ADKeypad to Pin 2. Make sure the colour of the wire of the buzzer and the ADKeypad follows the colour of the pins on the breakout board i.e. red to red, yellow to yellow.
Click on Advanced in the Code Drawer in Microsoft MakeCode to see more code sections.
To code for our extra kit components (the ADKeypad and the buzzer), we have to add a package of code. Look at the bottom of the Code Drawer for “Add Package” and click it. This will open up a dialogue box. Search for “tinker kit” and click on it to download this package.
Note: If you get a warning telling you some packages will be removed because of incompatibility issues, either follow the prompts or create a new project in the Projects file menu.
Next, let’s create a conditional statement as shown in the picture. This ‘if-then’ block of code is under the code section “Logic” of the code drawer. The code shown below means that when button A is pressed on the ADKeypad (while the ADKeypad is plugged in at pin P2 of the breakout board), the buzzer will play a sound of 175 hertz.
Since there are 5 buttons, we need to code 5 similar conditional statements. Each button controls a sound of a particular pitch. So press each buttion, we will get sounds of different pitches.
If you don’t want to type these code by yourself, you can download it directly from the link below:
Or, you can download from the page below:
Success! Now you have your own Micro:bit Music Machine.
Tinker Kit Projects
- Project 01 – Music Machine
- Project 02 – Smart Light
- Project 03 – Electro-Theremin
- Project 04 – Simple Alarm Bot
- Project 05 – Plant Monitoring Device
- Project 06 – Intruder Detection
- Project 07 – Fish Feeder
- Project 08 – Motion Detector
- Project 09 – Lie Detector
- Project 10 – PADDLEBALLSUPERSMASHEM
- Project 11 – Avoid Asteroids
- Project 12 – Remote Control Everything
- Project 13 – micro:bit Car
- Project 14 – Flipping Pancakes
- Project 15 – Maze Runner
- Project 16 – QUICK MATHS
- Project 17 – Pitch Perfect
- Project 18 – Finger Dexterity
- Project 19 – Electric Spirit Level
- Project 20 – Space Shooter
- Project 21 – Flappy Bird
- Project 22 – Wire Transmission
- Project 23 – Snake Game