pxt-calliope/docs/reference/radio.md
Peli de Halleux 6209f0cc63
scratch like broadcast api (#1358)
* scratch like broadcast api

* always register handler

* adding docs

* added icon

* updated block name

* adding DAL support "radio.raiseEvent"

* typo

* implemented using radiobus

* adding docs

* adding raise event block

* updated shims

* updated pxt
2018-10-08 09:46:23 -07:00

1.1 KiB

Radio

Communicate data using radio packets

radio.sendNumber(0);
radio.sendValue("name", 0);
radio.sendString("");
radio.onReceivedNumber(function (receivedNumber) { });
radio.onReceivedValue(function (name, value) { });
radio.onReceivedString(function (receivedString) { });
radio.setGroup(0);
radio.setTransmitPower(7);
radio.setTransmitSerialNumber(false);
radio.writeReceivedPacketToSerial();
radio.sendBuffer(null);
radio.raiseEvent(0, 0);
radio

See Also

sendNumber, sendValue, sendString, sendBuffer, onReceivedNumber, onReceivedValue, onReceivedString, setGroup, setTransmitPower, setTransmitSerialNumber, writeReceivedPacketToSerial, raiseEvent