MicroPython Guide

Make Python a piece of cake with this handy guide.

The MicroPython guide to BBC micro:bit

Python is a programming language that's used by beginner coders and computing experts alike. Python is entirely text-based, which may look intimidating at first, but with a little guidance and practice, anyone can start coding - and this guide is here to help!
The version of Python that the BBC micro:bit uses is called MicroPython. Click the links below to go to different sections of our MicroPython documentation which breaks down each feature your micro:bit can do using Python.

Introduction

So, what's Python about? Who uses it? What can Python do for my micro:bit? All those questions answered right below.

Hello World!

Let's start with the basics - making your micro:bit scroll "Hello World!"

Images

Get those 25 LEDs on your micro:bit under your control and find out about the fun pre-programmed pictures you can use in MicroPython.

Buttons

The A and B buttons on your micro:bit are one of the many 'inputs' it responds to. Learn how to use them here.

Input/Output

The strip of golden 'teeth' at the bottom of your micro:bit aren't just to be fashionable, they can be used to hook your micro:bit to all sorts of electronics!

Music

Attach a speaker to your micro:bit and suddenly it becomes a high-tech instrument! Learn about writing music for your micro:bit and the cool built-in melodies available.

Random

Take a chance and learn how to make your micro:bit mix things up using the Random module.

Movement

Bored of just using buttons? Use tilting and movement to tell your micro:bit what to do!

Gestures

Your micro:bit can tell which way up it's facing and how fast it's moving. Take advantage of these gesture codes and be a real smooth mover.

Direction

Did you know that the micro:bit not only has an accelerometer built-in but a compass? Head directly to the link below and find out more.

Speech

Your micro:bit will be the talk of the town with the Speech module! Follow this guide to make your micro:bit talk, do silly voices and even sing!

Network

Double the micro:bit, double the fun! Learn how to connect two micro:bits together using their Input/Output pins.

Next Steps

Always experiment, always explore, always learn! Once you get used to the coding concepts in this guide, read here to learn how to take things further.