2019-12-02 05:58:26 +01:00
# set Group
2016-03-25 16:47:20 -07:00
2016-06-01 17:11:28 -07:00
Make a program have the group ID you tell it for sending and receiving
2019-12-02 05:58:26 +01:00
with radio.
```sig
radio.setGroup(0);
```
A group is like a cable channel (a @boardname @ can only
2016-06-01 17:11:28 -07:00
send or receive in one group at a time). A group ID is like the cable
channel number.
2016-03-25 16:47:20 -07:00
2016-06-01 17:11:28 -07:00
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
2016-11-01 17:44:37 -07:00
the very same program onto two different @boardname@s , they will be able
2016-06-01 17:11:28 -07:00
to talk to each other because they will have the same group ID.
2016-03-25 16:47:20 -07:00
2019-12-02 05:58:26 +01:00
## Parameters
2016-03-25 16:47:20 -07:00
2019-12-02 05:58:26 +01:00
* **id**: a [number ](/types/number ) from ``0`` to ``255` `.
2016-03-25 16:47:20 -07:00
2022-08-10 18:36:19 +02:00
### ~ reminder
#### Default radio group
If you haven't set a radio group for the @boardname @, it will use one selected randomly. If you are transmiting data to a @boardname @ that has a different hardware version from the sending @boardname @, it will select a random default group that is not the same as the other @boardname @. To be certain that your program will send or receive data using the same radio group, you will need to first choose and set a radio group for your program if you want it to work between different versions of the @boardname @.
### ~
2019-12-02 05:58:26 +01:00
## Simulator
2016-06-09 15:30:47 -07:00
2016-11-01 17:44:37 -07:00
This function only works on the @boardname @, not in browsers.
2016-06-09 15:30:47 -07:00
2019-12-02 05:58:26 +01:00
## Example
2016-03-25 16:47:20 -07:00
2016-06-01 17:11:28 -07:00
This program makes the group ID equal 128.
2016-03-25 16:47:20 -07:00
```blocks
radio.setGroup(128)
```
2019-12-02 05:58:26 +01:00
## See also
2016-03-25 16:47:20 -07:00
2019-12-02 05:58:26 +01:00
[on received number ](/reference/radio/on-received-number ),
[on received string ](/reference/radio/on-received-string ),
[on received value ](/reference/radio/on-received-value ),
2016-10-24 16:30:21 -07:00
[send number ](/reference/radio/send-number ),
[send value ](/reference/radio/send-value ),
[send string ](/reference/radio/send-string )
2016-03-25 16:47:20 -07:00
2016-08-09 16:28:08 +01:00
```package
2016-10-22 21:29:31 -07:00
radio
2016-08-09 16:28:08 +01:00
```