Goals

  • Get to know the ADKeyboard
  • Make something with ADKeyboard
  • Make something with Mini buzzer
MATERIALS:
1 x BBC micro:bit
1 x Micro USB cable
1 x Breakout board
1 x Mini buzzer
1 x ADKeyboard
2 x Female-Female jumper wires

  • We are going to create a music machine which the ADKeyboard will control the pitch of the sound

  • Connect the USB cable to the micro:bit and then to the breakout board as shown in the picture
  • Connect 2 wires to the buzzer
  • The longer pin on the buzzer will connect to the yellow pin on the break out board, while the shorter one connects to the black.

  • Plug in the buzzer to Pin 0
  • Make sure the colour of the wire follows the coloured pins on the break out board
  • Plug in the ADKeyboard to Pin 2
  • Click on Advanced in the Code Drawer to see more code sections
  • We’ll add a package of code to be able to use our kit components
  • Look at the bottom of the Code Drawer for Add Package and click it

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

  • Next, let’s create an ‘else-if’ statement as shown in the picture
  • The code means that when button A is pressed, the buzzer will play a sound

  • Since there are 5 buttons, we need to code 5 ‘else-if’ statements
  • When one of the buttons is pressed, the buzzer will play a sound at a particular pitch for 1 beat
  • Finally! You have completed a simple musci machine