Micro:bit revision guide

By Interwoven Maths

Practise Micro:bit View all questions Back to Computer Science

Everything you need to know

The Micro:bit is a small programmable board with sensors and outputs built in. Programming it links code to physical inputs and outputs.

What the board is

A Micro:bit is a microcontroller: a small computer on a single board, with a processor, memory and a display of 25 LEDs.

Inputs and outputs

Inputs include the buttons, the accelerometer, which detects movement and tilt, the compass, which detects magnetic direction, the light sensor, the temperature sensor and the microphone.

Outputs include the LED display and the speaker. The pins along the edge connect external components. The radio sends messages to other boards, and two boards must share a radio group to hear each other.

Programming the board

IF makes a decision and ELSE runs when the condition is false. A while loop repeats while a condition holds, a for loop a fixed number of times, and a forever loop continuously.

Code is event-driven: a block such as on button A pressed or on shake runs when that event happens, and on start runs once at the beginning. Setting a variable replaces whatever it held before.

Functions

A function is a named, reusable section of code, which keeps a program short and easier to follow.

Input, processing and output

A device can be modelled as taking an input, doing some processing and producing an output. Testing on the real board, rather than a simulator, checks how the sensors and outputs actually behave.

Back to Micro:bit practice ยท View all Micro:bit questions