Students use receivedNumber to do something different for each radio message, and send words with send string.
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 7 min · Investigate 10 min · Modify 8 min · Mix it up 3 min · Make 9 min · Doorbell 3 min
on radio received runs for every number that arrives, and receivedNumber (drag it out of the block) holds which number it was. One receiver block with if … else if handles every message; a second on radio received block greys out. send string and on radio received receivedString do the same for words. Each number is a code both micro:bits agree on: 1 means left, 2 means right.
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.
Pairs agree what 1, 2 and 3 mean (left, right, stop). One holds up fingers silently; the other acts it out.
A number only means something if both sides agree what it means.
One partner is the rider, the other the back light. The rider sends a signal; the back light calls out what it shows.
One receiver for every message. Ask what receivedNumber holds when B is pressed.
| What you will see | A question to ask | The fix |
|---|---|---|
| The receiver shows the same picture for every number. | Where do you check which number arrived? | Use if receivedNumber = 1 … else if receivedNumber = 2 inside on radio received. |
| receivedNumber cannot be found in Variables. | Where does receivedNumber come from? | Drag it out of the on radio received block itself. |
| A word is sent but nothing shows. | Which on radio received block is it, number or string? | Words arrive in on radio received receivedString. |
One possible solution for each task. Other correct programs are fine.

radio.setGroup(1)
input.onButtonPressed(Button.A, function () {
radio.sendNumber(1)
})
input.onButtonPressed(Button.B, function () {
radio.sendNumber(2)
})
input.onGesture(Gesture.Shake, function () {
radio.sendNumber(3)
})
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 1) {
basic.showIcon(IconNames.Heart)
} else if (receivedNumber == 2) {
basic.showIcon(IconNames.Sad)
} else if (receivedNumber == 3) {
basic.showIcon(IconNames.Surprised)
}
})

radio.setGroup(1)
input.onButtonPressed(Button.A, function () {
radio.sendNumber(1)
})
input.onButtonPressed(Button.B, function () {
radio.sendNumber(2)
})
input.onGesture(Gesture.Shake, function () {
radio.sendNumber(3)
})
input.onButtonPressed(Button.AB, function () {
radio.sendString("hi")
})
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 1) {
basic.showIcon(IconNames.Heart)
} else if (receivedNumber == 2) {
basic.showIcon(IconNames.Sad)
} else if (receivedNumber == 3) {
basic.showIcon(IconNames.Surprised)
}
})
radio.onReceivedString(function (receivedString) {
basic.showString(receivedString)
})

radio.setGroup(1)
input.onButtonPressed(Button.A, function () {
radio.sendNumber(1)
})
input.onButtonPressed(Button.B, function () {
radio.sendNumber(2)
})
input.onGesture(Gesture.Shake, function () {
radio.sendNumber(3)
})
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 1) {
basic.showArrow(ArrowNames.West)
} else if (receivedNumber == 2) {
basic.showArrow(ArrowNames.East)
} else if (receivedNumber == 3) {
basic.showIcon(IconNames.Surprised)
}
})
Open task: any program that does what the step asks.
Stretch: Make a two-way chat: each micro:bit sends 1 for 'yes' and 2 for 'no', and shows a tick or cross when the other answers.
Support: Give students the receiver with if … else if already built, and ask them to add the senders.
A receiver checks if receivedNumber = 1 and else if receivedNumber = 2. What happens when 3 arrives?
Nothing. Both questions are false and there is no else.
Next lesson: a list both micro:bits share turns the numbers into words. Class idea: a quiz buzzer where A and B are two answers.