Students read light, temperature and tilt as numbers, and see that a sensor read in forever follows the world while one read in on start gives a single moment.
Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
Predict and Run 8 min · Investigate 10 min · Modify 8 min · Mix it up 3 min · Make 7 min · Light meter 4 min
A sensor gives the program a number that the world keeps changing. In the simulator the controls appear only once a program uses a sensor: the light slider (sun), the temperature slider (thermometer), and tilt by moving the mouse over the micro:bit. The key idea is the forever loop from lesson 2: a sensor read in forever is read again and again; in on start, once.
On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.
One student reads a thermometer (or looks out of the window) and calls out what they see, again and again. A second student calls out only once, at the start.
Who still knows what the room is like after five minutes? That is forever against on start.
A sensor is read once in on start and many times in forever. When the number never changes, ask where the sensor block is.
| What you will see | A question to ask | The fix |
|---|---|---|
| The number never changes. | Is the sensor block in on start or in forever? | Move it into forever (or a button event) so it is read again. |
| The simulator has no slider. | Has the program got a sensor block in it, and is it running? | The slider appears only after a sensor block is used. Restart the simulator if needed. |
| The temperature seems too high on a real micro:bit. | Where is the sensor? | It is in the processor, which warms up as it works. It reads a little above the room. |
One possible solution for each task. Other correct programs are fine.

basic.forever(function () {
basic.showNumber(input.temperature())
})

input.onButtonPressed(Button.A, function () {
basic.showNumber(input.lightLevel())
})
input.onButtonPressed(Button.B, function () {
basic.showNumber(input.temperature())
})

basic.forever(function () {
basic.showNumber(input.temperature())
basic.showString("C")
basic.pause(2000)
})
Open task: any program that does what the step asks.
Stretch: Show tilt as a number with acceleration x, then make A show tilt left and right and B show tilt forward and back (acceleration y).
Support: Give students the thermometer's forever block with show number already in it, and ask them to add the C and the pause.
Why does reading the temperature in on start not work for a thermometer?
on start reads it once, at the start. A thermometer must read it again and again, in forever.
Next unit: the micro:bit decides what to do using these numbers (if it is dark, light up). Class ideas: measure the brightest and darkest spots in the room with real micro:bits; record the temperature by a window every lesson for a week.