BBC micro:bit

The BBC micro:bit is a pocket-sized, codable computer that allows anyone to get creative with technology. Made possible through a major partnership with 31 organisations, a micro:bit has been given to every 11 or 12 year old child in year 7 or equivalent across the UK, for free.

The official website for the BBC micro:bit is

If you're keen to try using the micro:bit with mbed, then start with this platform page to add it to your compiler (on the right hand side), then check out the activity on the micro:bit team page.

Only the BBC micro:bit V1.3x is currently supported in the mbed online compiler. If you have the V1.5 or the V2.0 device, you will need to use the offline development tools provided for the micro:bit

If you're new to mbed, there's a video showing your first example here

The BBC micro:bit is based on the mbed HDK. The target MCU is a Nordic nRF51822 with 16K RAM, 256K Flash. As well as the nRF51822 there's also an onboard accelerometer and magnetometer from Freescale.


Microbit Pinout

micro:bit Device Abstraction Layer (DAL)

Lancaster University have written a full abstraction of the hardware on the micro:bit, based on mbed. This is used by the higher level languages provided by the BBC and is perfect for creating projects in mbed that use the various pieces of hardware on the micro:bit.


Lancaster University have prepared full API documentation and a getting started guide. These live at their own home, hosted from GitHub

If you'd like to use just part of the DAL, the documentation for that is in the advanced guide

There is a set of examples that show how to use the MicroBit class: They can all be found at the micro:bit team, but the simplest is the basic 'hello world'

Import programmicrobit-hello-world

An example of how to use the micro:bit DAL's abstraction for a simple 'Hello World' on the micro:bit display. This is a one-way translation of the microbit-samples repository on GitHub. Please don't try to push changes here, instead push them to the source repo at

And this example, taken from the advanced guide shows using just the display component:

Import programmicrobit-component-display

Example display component code from

Getting Started Video


  • Can be programmed with high-level online IDEs using the BBC's website at including:
    • Microsoft TouchDevelop IDE
    • Microsoft Blocks
    • CodeKingdoms Javascript
    • MicroPython
  • mbed enabled
    • Online IDE at
    • Easy to use C/C++ SDK
    • Dedicated micro:bit runtime libraries for rapid development (developed by Lancaster University)
  • Nordic nRF51822 Multi-protocol Bluetooth® 4.0 low energy/2.4GHz RF SoC
    • 32-bit ARM Cortex M0 processor (16MHz)
    • 16kB RAM
    • 256kB Flash
    • Bluetooth Low Energy Master/Slave capable
  • Input/Output
    • 25 LED Matrix
    • Freescale MMA8652 3-axis Accelerometer
    • Freescale MAG3110 3-axis Magnetometer (e-compass)
    • Push Button x2
    • USB and Edge connector Serial I/O
    • 2/3 reconfigurable PWM outputs
    • 5 x Banana/Croc-clip connectors
    • Edge connector
    • 6 x Analog In
    • 6-17 GPIO (configuration dependent)
    • SPI
    • i2c
  • USB Micro B connector
  • JST power connector (3v)

mbed Libraries

The DAL described above contains all code required to use the micro:bit with mbed, but if you're looking to use just the underlying mbed libraries, for example for greater portability to other mbed platforms that don't have the same features as the micro:bit, you can use other libraries directly. For example

For Bluetooth Low Energy, the mbed BLE_API:

Import libraryBLE_API

High level Bluetooth Low Energy API and radio abstraction layer

For more information, see the Bluetooth Low Energy team /teams/Bluetooth-Low-Energy/

Or these component libraries:

Components / NXP MAG3110 Magnetometer
The MAG3110 is a small, low-power digital 3-D magnetic sensor with a wide dynamic range to allow operation in PCBs with high extraneous magnetic fields.
The MMA8652 is a 12 bit, 3 axis accelerometer


You can find the latest firmware at

micro:bit availability

The micro:bit is available from a number of different online retailers, and in quantities >90 from CPC in the UK.

More information, including a registration for for schools to request micro:bits can be found here

 Buy Now