Year 7
micro:bit Reference
Everything you need to programme, connect and troubleshoot your micro:bit.
What is the micro:bit?
A tiny, pocket-sized computer. Here's what's on the front face:
MakeCode quick reference
| Block | What it does | Used in |
|---|---|---|
show string | Scrolls text across the LED grid. | Lesson 2 |
show icon | Displays a fixed image on the LED grid. | Lesson 2 |
pause (ms) | Waits before running the next block. | Lesson 7 |
forever | Repeats the blocks inside it forever. | Lesson 7 |
on button A pressed | Runs code when button A is pressed. | Lesson 10 |
if / else | Runs different code depending on a condition (selection). | Lesson 10, 11 |
on shake | Runs code when the micro:bit is shaken (accelerometer). | Lesson 11 |
pick random | Picks a random number in a range. | Lesson 11 |
change variable by | Adds to or subtracts from a stored number, e.g. a score. | Lesson 10, 11 |
Step-by-step: connecting and downloading
- Plug your micro:bit into the computer with a USB cable.
- It should appear as a drive called MICROBIT.
- Build your programme at makecode.microbit.org.
- Click Download — this saves a
.hexfile. - Drag the
.hexfile onto the MICROBIT drive. - Wait for the yellow light on the back to stop flashing — that means it's saved.
Troubleshooting
Check the USB cable is a data cable, not just a charging cable. Try a different USB port. If it still doesn't work, restart the computer.
Re-download the file and make sure it lands on the MICROBIT drive, not somewhere else like Downloads.
Check you used the right "on button pressed" block and that the download actually finished (the yellow light stopped flashing).
Check whether your blocks are inside "on start" (runs once) or "forever" (runs again and again) — you may have blocks in the wrong one.
Official tutorials
More step-by-step guides straight from the makers of MakeCode: makecode.microbit.org/projects
BLC