Skip to content

Your own MakeCode project (With pairing needed)#

You can create a Bluetooth-enabled MakeCode project yourself. Below are the detailed instructions to create a micro:bit MakeCode project, enable the Bluetooth extension and enable JustWorks pairing. A project with pairing enabled makes sure that only those devices/computers that are paired to it can connect to it.

However, it also has a few disadvantages

Create a project#

In MakeCode for micro:bit, select "New Project"

Start a new project

Enter a name:

Create project: give your project a name

Add the Bluetooth extension#

You'll need to add the Bluetooth extension.
Select "Advanced"

MakeCode project blocks: select advanced

Select "Extensions"

MakeCode project blocks: select extension

Search for Bluetooth, and select the Bluetooth extension

Extensions: search and select Bluetooth

A popup appears, informing you that the "radio" extension will be removed if you add Bluetooth. Select "Remove extension and add Bluetooth", this will only apply to this project.

Remove the radio extensions and add Bluetooth

Enable pairing#

In the top-right corner click on the cog icon and select project settings. Enable the "JustWorks pairing (default): Pairing is automatic once the pairing is initiated" option. Save the Settings.

Select JustWorks pairing in project settings

Add Bluetooth services#

Now you can select blocks from the bluetooth tab:

Select Bluetooth blocks

Drag the services you want to enable in an "On start" block

Drag Bluetooth services in On start

The micro:bit v1 has too little memory to enable all bluetooth services. If you try to enable them all, after copying the hex the micro:bit, the LED display wil show a sad face and then scroll 020, this means the micro:bit is out of memory. See also: the micro:bit error codes

Download the hex file#

Download the hex file and copy it to your micro:bit!