BBC micro:bit
About MicroPython

Introduction

MicroPython is an implementation of the Python scripting language that can be used to program the BBC micro:bit. The Python programming language was implemented in the late 1980s and has a large community of users.

Python offers us a flexible way to program the micro:bit. All of the code editors are a little restrictive in the range of statements available and, whilst they are designed to help youngsters construct statements, the user interfaces are not the quickest/easiest way to write code for people used to being able to type what they want to do rather than use drag drop operations.

Installation

You can use the MicroPython editor at the BBC micro:bit portal http://www.microbit.org.

Another benefit of using MicroPython is that you get to work fully offline. This means you will need to set up your computer with the right software.

Mu is an editor made for MicroPython. It can be downloaded from Mu GitHub. The latest builds of the software are available for download and there are versions for Windows, Mac and Linux.

Windows users need to use a driver to make a serial port connection between the PC and the micro:bit. This is used for flashing the micro:bit and for making it possible to get debug information from running programs. You can download the driver from here.

Using

With the driver installed, launch the Mu software. Type the program you want to flash to the micro:bit and press the Flash button. If there is an error in your program, you will see an error message scroll across the matrix on the micro:bit.

Mu MicroPython Editor

Documentation

You can find some tutorials and documentation for MicroPython with the micro:bit at the site, http://microbit-micropython.readthedocs.org/en/latest/index.html. There are lots of examples on this site.

You can get more help and reference material for the Python language itself at the site, https://docs.python.org/2/reference/.