42 lines
1.0 KiB
Markdown
Raw Normal View History

2016-03-25 16:47:20 -07:00
# Set Group
2016-06-01 17:11:28 -07:00
Make a program have the group ID you tell it for sending and receiving
2016-11-01 17:44:37 -07:00
with ``radio``. 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
2016-07-18 14:04:15 -07:00
```sig
radio.setGroup(0);
```
2016-03-25 16:47:20 -07:00
### Parameters
2017-03-16 07:57:41 -07:00
* ``id`` is a [number](/types/number) from ``0`` to ``255``.
2016-03-25 16:47:20 -07:00
2016-06-09 15:30:47 -07:00
### Simulator
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
2016-03-25 16:47:20 -07:00
### Example
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)
```
### See also
[on data packet received](/reference/radio/on-data-packet-received),
[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
```package
radio
```