Term 2 — Lessons 5–7

Unit 2 — micro:bit: First Steps & Making. Physical computing is a completely different experience to on-screen programming — you'll hold and interact with something you personally programmed.

Lesson 5 — Meet the micro:bit: Your First Physical Program

What you'll achieve: a programmed micro:bit with a scrolling name, an LED pattern and button reactions.

micro:bitMakeCode
micro:bit
A small physical computer with buttons, lights and sensors.
MakeCode
The block-based website used to program the micro:bit.
Flash / download
Sending a program from the computer onto the micro:bit.

I Do

The micro:bit is a real, physical computer with its own lights, buttons and sensors — today's program runs on real hardware, not just a screen. Watch your teacher open makecode.microbit.org, drag "show string" under "on start", connect a micro:bit by USB, click Download, and watch it light up. The first download sometimes needs a browser permission step (WebUSB pairing).

We Do

  1. Start a new project, drag "show string" under "on start" and change it to your name, then download and watch it scroll.
  2. Add "on button A pressed" (a heart icon), "on button B pressed" (an arrow icon) and "on button A+B pressed" ("Hi!"). Re-download and test each button.

You Do

  1. Under "on start", add "show string" with your name, then "show icon" of your choice.
  2. Add "on button A pressed" to show a different icon.
  3. Add "on button B pressed" to show a custom LED pattern.
  4. Add "on button A+B pressed" to show a heart or message.
  5. Download to your micro:bit and test every button.

Before You Go

What did you learn today? Explain in your own words.

Exit Ticket

Show what you've learned today.

Open Exit Ticket →

Lesson 6 — micro:bit Radio: Sending Wireless Messages

What you'll achieve: two micro:bits that send messages to each other through the air — no cables, on your own private channel.

micro:bitMakeCode
Radio
A way to send signals through the air, with no cables.
Group
The radio channel (0–255). Only micro:bits on the same group can talk to each other.
Send / Receive
Send means transmit a message. Receive means get a message.

I Do

Question: can one micro:bit control every micro:bit in this room — with no cables?

Everyone downloads the receiver code on group 1. Your teacher presses button A. Watch every board in the room.

This is radio. It is the same idea behind Bluetooth, Wi-Fi and wireless game controllers.

We Do

  1. Build three blocks together: Radio → radio set group 1 (inside "on start"), Input → on button A pressed with radio send string "HELLO", and Radio → on radio received receivedString with show string receivedString.
  2. Test in the simulator. MakeCode now shows two micro:bits. Press A on one and watch the other.
  3. Everyone downloads and presses A on group 1. What happens? Why is it a problem?

You Do

Work in pairs. Each person needs one micro:bit.

  1. Choose a group number between 1 and 255 with your partner. Keep it private.
  2. Change radio set group to your number on both micro:bits.
  3. Button A: send a message to your partner. Maximum 19 characters.
  4. Button B: use radio send number 1. Then add on radio received receivedNumber and show icon (a heart).
  5. Download to both micro:bits and test every button.

Intercept the code: I will send a code on a hidden group between 1 and 12. Change your group, receive the code and be the first pair to say it out loud.

Extra challenge: add on shake to send "SOS" to your partner.

Starter Code

radio.set_group(1)

def on_button_pressed_a():
    radio.send_string("HELLO")
input.on_button_pressed(Button.A, on_button_pressed_a)

def on_received_string(receivedString):
    basic.show_string(receivedString)
radio.on_received_string(on_received_string)

Before You Go

What did you learn today? Explain in your own words.

Exit Ticket

Show what you've learned today.

Open Exit Ticket →

Lesson 7 — micro:bit Project: Make Something Useful

What you'll achieve: a student-chosen micro:bit project — a step counter, reaction timer or digital dice — presented to the class.

micro:bitMakeCode
Debug
To find and fix a mistake in a program.
Random number
A value chosen unpredictably by the computer, used in games of chance.
Millisecond (ms)
A unit of time; 1000 ms equals 1 second.

I Do

Watch a quick demo of all three projects: a step counter counting shakes, a reaction timer measuring milliseconds, and a digital dice showing a random 1–6 number on shake. Today is more independent — pick ONE project and build it end to end; the teacher circulates to help rather than demonstrating everything live.

We Do

Build the shared pattern all three projects use together: "on start, set counter to 0", then "on shake, change counter by 1, show number (counter)". Shake three times and check it shows 3.

You Do

  1. Step counter: on shake, change counter by 1, show number (counter).
  2. Reaction timer: on start, record a start time; on button A pressed, show the time elapsed since start.
  3. Digital dice: on shake, set "roll" to a random number 1–6 and show it.
  4. Download, test at least 5 times, and prepare a one-sentence explanation of how your code works.

Before You Go

What did you learn today? Explain in your own words.

Exit Ticket

Show what you've learned today.

Open Exit Ticket →