set Group

Set the group ID for sending and receiving messages over radio.

radio.setGroup(0)

A group is like a cable channel (a Calliope mini 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 Calliope minis, they will be able to talk to each other because they will have the same group ID.

Parameters

  • id: a radio group ID number from 0 to 255.

Default radio group

If you haven’t set a radio group for the Calliope mini, it will use the default group number of 0.

Simulator

This function only works on the Calliope mini, not in browsers.

Example

Set a radio group to send and receive a number between Calliope minis.

radio.setGroup(1)
radio.onReceivedNumber(function (receivedNumber) {
    basic.showNumber(0)
    basic.clearScreen()
})
input.onButtonPressed(Button.A, function () {
    radio.sendNumber(0)
})

See also

on received number, on received string, on received value, send number, send value, send string

funk