Send a place number that stands for a word in a list both micro:bits share.
Morse code, flag signals and the numbers a fast-food counter calls out all work because both sides agree what each code means.
Last lesson, 1 meant "left" and 2 meant "right" because you decided so. A list makes that agreement clear: if both micro:bits have the same list of words, sending a place number is enough. The receiver looks up the word at that place.
Make your prediction first. Help opens once you've locked it in.

let words = ["Hi", "Yes", "No"]
radio.setGroup(1)
radio.onReceivedNumber(function (receivedNumber) {
basic.showString(words[receivedNumber])
})
input.onButtonPressed(Button.A, function () {
radio.sendNumber(2)
})
The receiver shows get value at receivedNumber: the word at the place that arrived.
Press A on one micro:bit and read the word on the other.

let words = ["Hi", "Yes", "No"]
radio.setGroup(1)
radio.onReceivedNumber(function (receivedNumber) {
basic.showString(words[receivedNumber])
})
input.onButtonPressed(Button.A, function () {
radio.sendNumber(2)
})
A steps through the list; B sends the place number of the chosen word.

let words = ["Hi", "Yes", "No"]
let choice = 0
radio.setGroup(1)
input.onButtonPressed(Button.A, function () {
choice += 1
if (choice == words.length) {
choice = 0
}
basic.showString(words[choice])
})
input.onButtonPressed(Button.B, function () {
radio.sendNumber(choice)
basic.showIcon(IconNames.Yes)
})
radio.onReceivedNumber(function (receivedNumber) {
basic.showString(words[receivedNumber])
})
Ella's list:

let words = ["Hi", "Yes", "No"]
Tom's list:

let words = ["Yes", "No", "Hi"]
In Python, the receiver is one line: basic.show_string(words[receivedNumber]). The square brackets mean "the item at this place", just like get value at.
This messenger lets you choose a word with A, then send it with B. Fill in choice after each press of A.
| press | choice after | word shown |
|---|---|---|
| (start) | 0 | |
| A | ||
| A | ||
| A |
Add a fourth word. Did you need to change anything else? Why not?
Click + on the list block. Both micro:bits run the same program, so one change updates both lists.
Make the receiver reply: when a word arrives, it sends back 99, and the sender shows a tick when 99 arrives. Real messaging apps do this to show "delivered".
In on radio received: if receivedNumber = 99, show a tick; else show the word and send 99.
Ask about 99 first, because 99 is not a place in the list.
Add a fourth word to the list.
This ticks by itself when your blocks do what is asked.
Reply with 99 when a message arrives, and show a tick when 99 comes back.
This ticks by itself when your blocks do what is asked.

radio.setGroup(1)
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber > 3) {
basic.showIcon(IconNames.No)
} else if (receivedNumber > 1) {
basic.showIcon(IconNames.Sad)
} else {
basic.showIcon(IconNames.Happy)
}
})
What does this receiver show for each number that arrives?
| receivedNumber | shows |
|---|---|
| 1 | |
| 2 | |
| 5 |
Make a mood check-in for the start of class. Each student's micro:bit has a list of moods (at least three). A steps through them, B sends the chosen one, and the teacher's micro:bit shows it.
Make a list of moods and a variable mood. A changes mood by 1 and goes back to 0 at the end of the list.
B sends mood. on radio received shows get value at receivedNumber.
A mood check-in: A chooses a mood from a list, B sends its place, and the other micro:bit shows the mood.
This ticks by itself when your blocks do what is asked.
This buzzer lets you pick an answer, A, B or C, and send it to the quiz master. Add a fourth answer, D, then make the quiz master's micro:bit show a tick after each answer arrives.
Students send a place number that stands for a word in a list both micro:bits share, and see that a message is a code both sides must agree on. About 45 minutes.
Open the teacher guide: answers, solutions, slides and a worksheet.
This lesson joins earlier ideas: lists (places from 0), variables (the chosen place) and radio. Both micro:bits hold the same list of words. Instead of sending a word, the sender sends its place number; the receiver shows the word at that place (get value at receivedNumber). That shared list is a code, and both sides must agree on it exactly: same words, same order. Stepping through a list uses a variable that goes up by 1 and goes back to 0 when it reaches the length. A reply (such as 99 for "got it") is just another agreed number that is not a place in the list.
Both sides must share the same list in the same order. When the wrong word shows, ask them to compare the two lists item by item.
Stretch: Send two numbers in one message: the sender's player number times 10, plus the word's place (so 23 means player 2 said word 3). Decode it on the receiver.
Support: Give students the mood list and the A stepping blocks, and ask them to add the sending and receiving.
Next unit: time. The micro:bit can measure how long something takes. Class ideas: a class emoji vote; a secret code where groups invent their own word lists and swap them.