Free Canadian Shipping on orders over $150 using the discount code "FREESHIP" at checkout!

:Klef Micro:Bit Piano From Kitronik

November 05, 2018

:Klef Micro:Bit Piano From Kitronik

Unboxing  / Testing video HERE ! 

MakeCode Setup Tutorial

You'll need

 

We've premade two example setups files for you. 

MakeCode Example ONE : Play notes right away.

Plug in Micro:Bit to computer. 

Basic Automatic Piano Setup HEX File  

click EDIT

Download  and Drag onto your MicroBit. 

Wait for it to stop flashing. It will dismount & then remount.

Then EJECT the Micro:Bit (varies depending on Win or Mac ). 

Unplug USB.

Insert Micro:Bit into Piano

Switch the USB cable to the top of the piano. 

Play Piano !

 

MakeCode Example TWO : Learn individual key assignment

This example will open MakeCode & you can see how I assigned the capacitive touch based on these port numbers on the bottom.

 

Manual Key Assignment HEX File

click EDIT

Download  and Drag onto your MicroBit. 

Wait for it to stop flashing. It will dismount & then remount.

Then EJECT the Micro:Bit (varies depending on Win or Mac ). 

 

Unplug USB.

Insert Micro:Bit into Piano

Switch the USB cable to the top of the piano. 

 

Play Piano !

For this demo code, instead of octave shifting, the piano Arrow buttons, as well as Buttons  A & B will display some fun LED Icons.  

 

MakeCode Tutorial THREE : How Examples 1 & 2 were made.

Open MakeCode. 

Expand ADVANCED > EXTENSIONS

 

 

Enter KLEF into the Search Bar. Select it. 

You should now see the :Klef library in your Blocks

 

 

To recreate Example One

 

To recreate Example Two Replace the FOREVER Loop with a nested If Else Loop. Assign Each Key & note. Refer to the back of the piano. 

These will probably be easier to read by opening the MakeCode Example file linked earlier. 

End of Make Code Blocks Tutorials

Go make something fun!

 

Once you've mastered those tutorials & you love MicroPython & if you want to get more into direct c-like arrays & address assignment...

Alternate (Experimental) MicroPython instructions. 

You'll need :   

  • a python editor (this tutorial uses Mu)
  • this Kitroink sample code from github
  • Micro:Bit
  • micro USB cable
  • one :Klef Piano
  •  

    Open MU

    LOAD the file Klef-piano.py off the Github repository. 

     

    Once you have the Code loaded, FLASH it to your Micro:BIt

     

     

    Unplug Micro:Bit, insert into the :Klef and then insert the micro USB into the KLEF PIANO not the microbit. It will give you an error otherwise. 

     

    You can also think about using the onboard breakouts to control things via jumper wires. 

     

    You will notice the default volume is quite LOUD.

    Now go make beautiful music all night long so your neighbors can hear. 

     

     





    Also in News

    Getting Started with Sid - Pico Plant System
    Getting Started with Sid - Pico Plant System

    August 10, 2021

    The Pico is a great board with a lot of excellent compact build options. For this project I’ll be making an automatic plant watering system with the help of the Pico to keep it running.

    Continue Reading

    Getting Started with Sid - Raspberry Pi Pico
    Getting Started with Sid - Raspberry Pi Pico

    July 28, 2021

    Raspberry Pi Pico’s are a great microcontroller that has a fair amount of range, despite the slightly more tricky set up process, once it’s ready to go there’s a lot you can do. 

    Continue Reading

    Getting Started with Sid - Theremin Gloves
    Getting Started with Sid - Theremin Gloves

    July 19, 2021

    Continue Reading