Learn the basics

Radio between Micro:bits

Micro:bits talk to each other without wires: the radio group, sending a number, and reacting when one arrives.

The Micro:bit board

Radio between Micro:bits

Every Micro:bit has a small radio. One Micro:bit sends a number (or a word); every Micro:bit nearby that listens on the same group receives it, a few metres away and through walls.

Same group number on both Micro:bits; one sends, the other reacts in "on radio received".

More: groups, and a first program

The group is a number from 0 to 255, like a channel. In a classroom every pair picks its own group, otherwise all cars obey all remotes. Put the same program on two Micro:bits: press A on one, and the other shows 1.

The MakeCode blocks of this program
The same in Python
radio.set_group(7)

def on_button_pressed_a():
    radio.send_number(1)
input.on_button_pressed(Button.A, on_button_pressed_a)

def on_received_number(receivedNumber):
    basic.show_number(receivedNumber)
radio.on_received_number(on_received_number)