set Group
Make a program have the group ID you tell it for sending and receiving with radio.
radio.setGroup(0);
A group is like a cable channel (a micro:bit can only send or receive in one group at a time). A group ID is like the cable channel number.
If you do not tell your program which group ID to use with this function, it will figure out its own group ID by itself. If you load the very same program onto two different micro:bits, they will be able to talk to each other because they will have the same group ID.
Parameters
- id: a number from
0
to255
.
Simulator
This function only works on the micro:bit, not in browsers.
Example
This program makes the group ID equal 128.
radio.setGroup(128)
See also
on received number, on received string, on received value, send number, send value, send string
radio