Complete guide for physical computing with micro:bit boards (weeks 19-24).
- Small programmable computer (5cm × 4cm)
- Has LEDs, buttons, sensors (accelerometer, compass)
- Runs MicroPython (special Python for microcontrollers)
- Perfect for physical computing projects
- 1× BBC micro:bit v1 or v2 (v2 recommended)
- 1× USB cable (micro-USB for v1, USB-C for v2)
- Computer with USB port
- Battery pack (2× AAA)
- Crocodile clips (for Week 22 pins)
- Buzzer, LED, servo (Week 22)
- 2nd micro:bit (Week 23 radio)
- Official: microbit.org/buy
- Amazon, Adafruit, SparkFun
- Cost: $15-25 per board
Mu is designed specifically for micro:bit programming.
macOS:
# Download from codewith.mu
# Or use Homebrew:
brew install --cask mu-editorWindows:
- Visit: https://codewith.mu/
- Download installer
- Run installer
- Allow in Windows Security if prompted
Linux:
pip3 install mu-editor-
Connect micro:bit
- Plug micro:bit into USB port
- Should show up as "MICROBIT" drive
-
Open Mu
- Click "Mode" button
- Select "BBC micro:bit"
-
Write code:
from microbit import * display.scroll("Hello!")
-
Flash to micro:bit
- Click "Flash" button
- Wait for yellow LED on micro:bit to stop flashing
- Message appears on LED display!
-
Success! ✅ You're ready for Week 19!
If installation is difficult, use browser-based editor.
- Visit: https://python.microbit.org/v/3
- Write code in browser
- Click "Download" button
- Drag downloaded .hex file to MICROBIT drive
- Code runs on micro:bit!
- Visit: https://makecode.microbit.org/
- Has Python mode
- Good for beginners
If micro:bit devices unavailable:
- python.microbit.org has built-in simulator
- Test code without hardware
- Shows LED display, button presses
- Limitation: No real sensor data, can't feel physical interaction
- Students write code, teacher demos on ONE physical micro:bit
- Rotate hardware between students
- Works but less engaging than 1:1
- MicroPython code compiles to
.hexfile - This is the "compiled" version for micro:bit
- Drag .hex to MICROBIT drive to upload
- Write code in Mu or online editor
- Click "Flash" (Mu) or "Download" (online)
- File saves as microbit-xxx.hex
- Drag file to MICROBIT drive
- Yellow LED flashes (uploading)
- micro:bit resets and runs code
- micro:bit not showing as drive: Try different USB cable (some are charge-only)
- Error on flash: Reset micro:bit (button on back)
- Code doesn't run: Check for syntax errors
- Partial upload: Wait for yellow LED to stop completely
from microbit import *
display.scroll("Hello World!")Expected: Text scrolls across LED display
from microbit import *
while True:
if button_a.was_pressed():
display.show(Image.HAPPY)
if button_b.was_pressed():
display.show(Image.SAD)
sleep(100)Expected: Press A = smiley, Press B = sad face
from microbit import *
while True:
if accelerometer.was_gesture('shake'):
display.show(Image.SURPRISED)
sleep(1000)
display.clear()Expected: Shake micro:bit = surprised face
If all 3 work: ✅ Setup complete!
- Variables, loops, if/else, functions
- Lists, strings, numbers
- All Python basics from weeks 1-6 work!
from microbit import *(special import)display.show()instead ofprint()- Hardware-specific: buttons, LEDs, sensors
- Some libraries unavailable (no Pygame, Turtle)
- Input: Buttons, sensors, pins
- Processing: Python logic (same as always!)
- Output: LEDs, display, music, pins
-
Check all USB cables
- Test each cable (some are broken)
- Label working cables
-
Pre-flash test program
- Flash "Hello" program to all micro:bits
- Confirms all working before lesson
-
Charging strategy
- Battery packs for portable projects
- USB for development/testing
-
Pairing if using radio (Week 23)
- Set same radio group number
- Test in pairs before full class
-
Backup computers
- Online editor as fallback
- Guest accounts ready
macOS:
- System Settings → Privacy & Security → Files and Folders
- Allow Terminal/Mu to access removable volumes
Windows:
- Device Manager → check for "MICROBIT" under Portable Devices
- Update drivers if needed
Solution: Try different USB port, restart computer
Mu Editor:
- Click "Check" button (shows Python errors before flashing)
- Read error messages carefully
Common errors:
# Wrong:
from Microbit import * # Capital M
while true: # lowercase true
# Correct:
from microbit import * # lowercase m
while True: # Capital TCause: No loop!
# Runs once:
display.show(Image.HEART)
# Runs forever:
while True:
if button_a.was_pressed():
display.show(Image.HEART)Solution: Use was_pressed() not is_pressed()
# Better:
if button_a.was_pressed(): # Detects button press event
do_something()
# Works but tricky:
if button_a.is_pressed(): # Checks if currently held
do_something()| Week | Hardware Needed | Can Use Simulator? |
|---|---|---|
| 19 | micro:bit only | ✅ Yes |
| 20 | micro:bit only | ✅ Yes (limited) |
| 21 | micro:bit only | Partial (no real sound) |
| 22 | + LED, buzzer, clips | ❌ No (needs hardware) |
| 23 | 2× micro:bits | ❌ No (needs radio) |
| 24 | Depends on project | Varies |
- micro:bit Discord
- micro:bit subreddit (r/microbit)
- Never connect 3V to GND directly (short circuit!)
- Use correct resistors for LEDs (150-330Ω)
- External power for servos (don't power from micro:bit)
- Adult supervision for soldering
- Crocodile clips safer than breadboard for beginners
- Use AAA batteries only (not 9V or lithium)
- Remove batteries when not in use
- Don't mix old and new batteries
Before Week 19:
- micro:bit hardware acquired
- Mu editor installed OR online editor tested
- Can flash code to micro:bit
- Test programs work (Hello, buttons, shake)
- USB cables tested and working
- Backup plan ready (simulator/sharing devices)
If all checked: ✅ Ready for weeks 19-24 - physical computing!