Introduction: Make a Music Machine With ElecFreaks Micro:bit Tinker Kit

Picture of Make a Music Machine With ElecFreaks Micro:bit Tinker Kit

Goals

• Get to know the ADKeypad.

• Make something with ADKeypad.

• Make something with Buzzer.

Step 1: Materials

1 x BBC Micro:bit Board

1 x Micro USB cable

1 x ElecFreaks Micro:bit Breakout Board

1 x Octopus Passive buzzer Brick

1 x Octopus ADKeypad

Tips: If you want all components above, you may need ElecFreaks Micro:bit Tinker Kit.

Step 2: Procedure

Step 1

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.

Step 3: Procedure

Step 2

Plug in the buzzer Brick 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.

Step 4: Procedure

Step 3

Click on Advanced in the Code Drawer 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.Copy and paste this link into "Add Package" text field:

https://pxt.microbit.org/50544-64675-33322-24641

Click on the search icon or press enter.

Then, click on the Tinkercademy button.

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.

Click on Tinkercademy inside the Code Drawer to find our custom blocks for the various components in your kit.

Step 5: Procedure

Step 4

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.

Success! You now have your own Micro:bit Music Machine.

Step 6: Relative Readings:

Comments

About This Instructable

325views

4favorites

License:

Bio: ElecFreaks is an open design house founded in March 2011. Our goal is to create rapid prototypes and give small-batch manufacture solution for makers and ... More »
More by ElecFreaks:A Creative Maker in Halloween and Elecfreaks Promotion ComingNeoPixels Matrix:Snake GameTo Do PADDLEBALLSUPERSMASHEM With Micro:bit
Add instructable to: