Microsoft MakeCode editor for micro:bit allows you to program your micro:bit using block-based programming language.
2. Microsoft MakeCode - 图1

How to Add Extensions(or Packages)

Most hardware extensions (e.g. a motor controller) for micro:bit also comes with extensions (or packages) for the MakeCode editor. Adding the extensions to your project can make your life much easier controlling the features of your extension board. The following contents shows you how to add the extensions step-by-step:
1. Find the access to the extension page by clicking setting icon:

2. Microsoft MakeCode - 图2

or in the Advanced => Extensions block categories.

2. Microsoft MakeCode - 图3

  1. Search the extension by keywords (e.g. ‘bitkit’)
    2. Microsoft MakeCode - 图4

or enter the github URL (eg. https://github.com/seeed-studio/pxt-grove-zero-for-microbit)
2. Microsoft MakeCode - 图5

  1. Click the extension and the Blocks and JavaScript definitions will be automatically loaded in the editor as shown below.
    2. Microsoft MakeCode - 图6

Programming steps
  • Step 1 Go to MakeCode: https://makecode.microbit.org/
  • Step 2 Connect the micro:bit to your PC with a USB cable. When successfully connected, the power indicator LED on the back of the micro:bit will light up. Open “This PC” and you will see that there is a MICROBIT drive in the list.
  • Step 3 Create a new project which takes you to the workspace, as shown below. Let’s write a simple program that will display a heart pattern on the LED matrix. Move on to the next step after you finish.
    2. Microsoft MakeCode - 图7
  • Step 4 Download the program to the micro:bit. Name your project a title, e.g. show heart icon.
    2. Microsoft MakeCode - 图8
    First, click “Download” on the bottom left of the interface and select “Save as” in the pop-up dialog box to save the .hex file. Next, in another pop-up dialog box, select MICROBIT drive and click “Save” (If “Save as” isn’t found, you need to search for the downloaded .hex file yourself, then copy or drag it onto the MICROBIT drive). When downloading, the indicator blinks but will become steady once the process is finished.