14. Case 13: Lively Music

14.1. Introduction

Make an electronic piano through micro:bit with the trimpot module.

../../_images/case_13_01.png

14.2. Quick to Start


Mterials


Nezha expansion board × 1

micro:bit × 1

Trimpot × 1

RJ11 wires × 1

Bricks × n

../../_images/case_13_02.png

Bricks Details


../../_images/Bricks_case_13.png

Connection Diagram


  • Connect the trimpot to J1 port on the Nezha expansion board.

../../_images/case_13_03.png

Build the Device


  • Build a device as the below picture shows.

../../_images/case_13_04.png

../../_images/case_13_05.png

../../_images/case_13_06.png

../../_images/case_13_07.png

Video reference for building:https://youtu.be/G0hycQ2rxCk

14.3. MakeCode Programming.


Step 1


Click “Advanced” in the makecode drawer to see more choices.

../../_images/case_01_10.png

We need add a package for programming. Click “Extensions” in the bottom of the makecode drawer and search with “Planet X” to have the package downloaded.

../../_images/case_01_11.png

Note: If you met a tip indicating it might be deleted due to incompatibility, you may continue as it indicates or create a new project in the menu.

Step 2


Programme

../../_images/case_13_15.png

Result

  • The tones could be adjusted via the trimpot.