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 as a Sensor: Building a Mood Detector

What you'll achieve: a temperature-based mood-detector micro:bit program.

micro:bitMakeCode
Sensor
A part of a device that detects something about the world, such as light, movement or heat.
Accelerometer
The sensor that detects shaking and tilting.
Threshold
A value used to decide between two outcomes, such as above or below 20°C.

I Do

The accelerometer is a motion sensor — watch your teacher shake a micro:bit already showing a surprised face on shake. Today's build reads temperature and decides which face to show using if/else: "forever" → "if temperature > 20 then show icon (happy) else show icon (sad)". The sensor reads the chip's own temperature, which changes slowly and is affected by touch.

We Do

  1. Build the forever loop checking temperature against a threshold, showing a happy or sad face. Test by cupping the board in your hands.
  2. Add "on shake" to show the string "Whoa!" as a separate event.

You Do

  1. Set an "on start" icon as a default face.
  2. Build a "forever" loop checking temperature against a threshold you choose.
  3. Add an "on shake" event showing a surprised icon and "Whoa!".
  4. Add "on button A pressed" to show the exact temperature number.
  5. Download and test all three behaviours.

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 →