Students make programs that wait for a button press or a shake, and see that an event block runs its blocks every time its event happens, and only then.
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 10 min · Investigate 10 min · Modify 8 min · Mix it up 3 min · Make 10 min · Indicator 4 min
An event is something that happens: a button press, a shake. An event block (such as on button A pressed) holds blocks that run every time that event happens, and only then. Compare with the last two lessons: on start runs once, forever runs again and again by itself. In the simulator, students click the A and B buttons, and click SHAKE for a shake. Try the Make yourself: four event blocks, one picture in each.
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 is the micro:bit with a face card for each event. The class calls out "A", "B" or "shake"; the micro:bit shows only the card for that event.
When nobody calls anything, nothing happens. That is what waiting means.
An event block runs only when its event happens. When a press does nothing, ask which block the picture is inside.
| What you will see | A question to ask | The fix |
|---|---|---|
| Pressing a button does nothing. | Which block is your picture inside? | Put it inside 'on button A pressed' (from Input), not in on start. |
| A+B never fires: A or B fires instead. | Did you press both at once? | In the simulator, click the A+B button below the micro:bit. On a real micro:bit, press both together. |
| Two event blocks for the same button, and only one seems to work. | How many 'on button A pressed' blocks are there? | Keep one block per event, and put everything for that press inside it. |
One possible solution for each task. Other correct programs are fine.
Open task: any program that does what the step asks.

basic.showIcon(IconNames.Asleep)
input.onButtonPressed(Button.A, function () {
basic.showIcon(IconNames.Yes)
})
input.onButtonPressed(Button.B, function () {
basic.showIcon(IconNames.No)
})
input.onButtonPressed(Button.AB, function () {
basic.showIcon(IconNames.Heart)
})

basic.showIcon(IconNames.Square)
input.onButtonPressed(Button.A, function () {
basic.showArrow(ArrowNames.West)
})
input.onButtonPressed(Button.B, function () {
basic.showArrow(ArrowNames.East)
})
input.onButtonPressed(Button.AB, function () {
basic.showIcon(IconNames.No)
})
input.onGesture(Gesture.Shake, function () {
basic.showIcon(IconNames.Surprised)
})
Open task: any program that does what the step asks.
Stretch: Make the signal board flash each arrow three times, and have shake show a short animation of three frames.
Support: Give students the four event blocks already placed and empty, and ask them only to fill in the pictures.
Why does 'if button A is pressed' in on start not work, when 'on button A pressed' does?
on start checks once, when the micro:bit switches on, before anyone presses. The event block waits and runs every time A is pressed.
Next unit adds variables, so a button can count presses. Class ideas: a quiz buzzer where A and B are two teams. With real micro:bits: wear one on a bag strap as a bike signal.