This guide is part of a three‑lesson sequence: Arrays → Radio → Emoji Catch. Each guide builds on the last and prepares students for the final two‑player game.
The micro:bit has a clever feature called radio. This lets two or more micro:bits send messages to each other wirelessly, like walkie-talkies, but for data! In this guide, we’ll explore how the radio works and then try a fun hands-on activity where pupils can secretly answer a question with Y (Yes) or N (No). Teachers can use this as a playful way of introduce coding concepts and communication between devices. This is one two primers, the other guide introduces arrays, preparing students for a final project that combines both sets of skills.
We recommend this guide as suitable for young coders aged 11+ that already have some basic coding under their belts, and have some understanding of what variables are and how to use them. We suggest that this activity should be very ‘hands-on’ for the teacher. Once the class has worked through this activity, pick one or more of the extensions task suggestions at the foot of this guide and take a step back and see how they get on.
How the radio works
- Radio group: Each micro:bit is assigned numbered group from 0 to 255 (a shared “channel”). Devices only hear messages from the same group.
- Messages: You can send text, numbers or images/emojis. Any micro:bit in the group can receive them. In theory, there is no limit to how many micro:bits can be in a single group, provided the micro:bits are all in range of the micro:bit sending the message.
- Controls: Buttons can be used to chose and send; in the later example, the LED matrix shows the current choice and any received messages as they arrive.
For our activity, pupils press A to toggle between Y and N, and press B to send their choice. The receiving micro:bit will display the answer it receives.
💻 Hands-on code example (drop onto both micro:bits)
Here’s a single program that handles both sending and receiving. Load it onto two micro:bits, set the same radio group number, and they’ll exchange secret answers.
🧩 Step-by-step in MakeCode blocks (sending and receiving)
-
Start the program:
Add an on start block. This is where the micro:bit gets ready before anything else happens. -
Join a radio group:
Inside on start, add radio set group and choose a number (for example, 1). All micro:bits that want to talk to each other must use the same group number. -
Create a variable for the answer:
Make a variable called choice. Still inside on start, set choice to"Y". Then add show string to display the starting value on the LEDs. -
Switch between Y and N:
Add an on button A pressed block. Inside it:- Add an if / else block.
- If
choice = "Y", change it to"N". - Otherwise, change it back to
"Y". - After the if/else, add show string choice so the micro:bit shows the new answer.
This lets pupils toggle between Y and N.
-
Send the answer:
Add an on button B pressed block. Inside it, place radio send string and choose the choice variable. Pressing B now sends the selected answer to the other micro:bit. -
Receive answers:
Add an on radio received receivedString block. Inside it, add show string receivedString. This makes the micro:bit scroll any answer it receives. -
Optional: Add a receiving beep
You can add a play tone block inside the radio receive event. This gives audio feedback when a message arrives. However, if the whole class uses the same tone, it can get noisy — so feel free to skip it or assign different tones to different pairs. -
Test it out:
Flash the same program onto both micro:bits. Make sure both are using the same radio group. Press A to choose Y or N, then press B to send it. The other micro:bit should scroll the answer it receives.
🎯 Possible question idea;
Ask a question like “Do you enjoy coding?”. Pupils secretly select Y or N with the A key on their micro:bit and press B to send. The receiving micro:bit displays responses one by one, demonstrating wireless communication while keeping choices private until revealed.
✨ What pupils learn
- Radio basics: Joining a group, sending, and receiving messages.
- Interaction: Using buttons and the LED matrix together.
- Logic: Variables and if/else for toggling values.
- Collaboration: Coordinating devices on a shared channel.
Extension suggestions
Once the class has been introduced to the micro:bit radio and worked through and completed the above example with the teacher, take a step back and give them other programming tasks to complete. Below are some possible challenges you can set to check understanding.
- Get the students to pick a new radio group for their pair of micro:bits, maybe keep a record of the radio groups in use to avoid over laps. Pick a number between 0 and 255, and check it’s not in use.
- Add a third option, a tick. This is so the receiver can let the sender know that they received the message.
- Get the pupils to swap out the Y, N answers for emojis. Smiley for Yes, Sad for No maybe?
- Hacking – have one group that uses their pair of micro:bits normally (Team A). Have the other groups to change their micro:bit radio groups to the same group as team A so that they can all ‘listen’ in to the secret transmission.
| Follow the full series below: Emoji Catch | |
|---|---|
| ▶ Primer 1: Arrays | 🔗 Intro to Arrays |
| ▶ Primer 2: Radio | 📍 You are here |
| ▶ Main Guide | 🔗 Emoji Catch Game |
