Default radio group
If you haven’t set a radio group for the micro:bit, it will use the default group number of 0.
Set the group ID for sending and receiving messages over radio.
radio.setGroup(0)
A group is like a cable channel (a micro:bit can only send or receive date in one group at a time) and the group ID is like the channel number.
If you load the same program onto two different micro:bits, they will be able to talk to each other because they will have the same group ID.
0 to 255.If you haven’t set a radio group for the micro:bit, it will use the default group number of 0.
This function only works on the micro:bit, not in browsers.
Set a radio group to send and receive a number between micro:bits.
radio.setGroup(1)
radio.onReceivedNumber(function (receivedNumber) {
basic.showNumber(0)
basic.clearScreen()
})
input.onButtonPressed(Button.A, function () {
radio.sendNumber(0)
})
on received number, on received string, on received value, send number, send value, send string
radio