back

Using the micro:bit editor

There are a number of different micro:bit editors available, and our projects make use of the MakeCode (PXT) blocks and JavaScript editor. You can create a new project at jumpto.cc/pxt-new.

MakeCode (PXT) Editor
MakeCode (PXT) Editor

You can also try out the MakeCode project embedded below:

The sections below show how to test, download and save projects. The first micro:bit project Interactive Badge includes information on using the MakeCode (PXT) editor.

Note that earlier versions of the Code Club micro:bit projects used the Code Kingdoms Editor. These projects can still be accessed as Archived Projects.

See also: (micro:bit.org Terms of Use)[http://microbit.org/terms-of-use/]

Testing scripts

You can test your micro:bit scripts using the emulator.

PXT Editor
PXT Editor

Your scripts will run and update automatically. You can also stop and restart scripts.

You’ll then be able to test your project without using a physical micro:bit.

Downloading and Transferring scripts

To transfer a script, you’ll first need to connect your micro:bit to your computer, via a USB cable. Your micro:bit will then appear in your file manager, just like any other removable storage device.

Clicking ‘Download’ will download a .hex file to your computer and save it in your Downloads directory (this is usually called Downloads, but different configurations are possible) or to a location of your choice via ‘Save As’.

screenshot
screenshot

You need to transfer the downloaded ‘.hex’ file to the micro:bit drive. There are several ways of doing this.

Whichever way you use, an LED will flash on the back of the micro:bit while the script is being transferred. When the LED stops flashing you can try out the script.

BBC micro:bit uploader

For Microsoft Windows you can use the BBC micro:bit uploader program to copy the latest ‘.hex’ file to the micro:bit automatically. The uploader can be downloaded and then run once at the start of each programming session.

If the uploader is running then a script will automatically be flashed to the micro:bit after clicking ‘Download’ and saving the ‘.hex’ file to the Downloads directory.

Without the BBC micro:bit uploader

Unfortunately, different browsers and operating systems use different approaches to saving downloaded files. You can find detailed instructions for transferring files using different browsers in Uploading programs on your micro:bit.

Instructions for the most common scenarios are included in the first micro:bit project: Interactive Badge.

We recommend that you find out which way works best for your web browser of choice and local setup and show that method to your Code Club.

File Manager

You can drag and drop a .hex file from the Downloads directory onto the micro:bit drive in your file manager.

Tip: Sort files by ‘Date modified’ to get the most recent file to the top.

Saving scripts

Saving scripts without a login

You don’t need an account to save your scripts. Just give your file a name and click the save icon to save your script as a ‘.hex’ file on the local file system. This saves the PXT project as part of the ‘.hex’ file.

screenshot
screenshot

Projects are also saved in local browser storage though this depends on your local setup permitting this.

Loading scripts

Click ‘Projects’ at the top of the editor to see your scripts. You can then click ‘Import File’ to load your .hex file to continue working on it.

screenshot
screenshot

To go back to a script, just click on it.

Sharing Projects

Please be aware that projects can be shared by clicking on the ‘Share’ button at the top of the editor so children should be reminded not to include personal information.