UNPKG

pxt-common-packages

Version:
31 lines 3.05 kB
{ "radio": "Communicate data using radio packets", "radio._packetProperty": "Gets a packet property.", "radio._packetProperty|param|type": "the packet property type, eg: PacketProperty.time", "radio.off": "Disables the radio for use as a multipoint sender/receiver.\nDisabling radio will help conserve battery power when it is not in use.", "radio.on": "Initialises the radio for use as a multipoint sender/receiver\nOnly useful when the radio.off() is used beforehand.", "radio.onDataReceived": "Used internally by the library.", "radio.onReceivedBuffer": "Registers code to run when the radio receives a buffer.", "radio.onReceivedNumber": "Registers code to run when the radio receives a number.", "radio.onReceivedString": "Registers code to run when the radio receives a string.", "radio.onReceivedValue": "Registers code to run when the radio receives a key value pair.", "radio.raiseEvent": "Sends an event over radio to neigboring devices", "radio.readRawPacket": "Internal use only. Takes the next packet from the radio queue and returns its contents + RSSI in a Buffer.\n@returns NULL if no packet available", "radio.receivedPacket": "Returns properties of the last radio packet received.", "radio.receivedPacket|param|type": "the type of property to retrieve from the last packet", "radio.sendBuffer": "Broadcasts a buffer (up to 19 bytes long) along with the device serial number\nand running time to any connected micro:bit in the group.", "radio.sendNumber": "Broadcasts a number over radio to any connected micro:bit in the group.", "radio.sendRawPacket": "Internal use only. Sends a raw packet through the radio (assumes RSSI appened to packet)", "radio.sendString": "Broadcasts a string along with the device serial number\nand running time to any connected micro:bit in the group.", "radio.sendValue": "Broadcasts a name / value pair along with the device serial number\nand running time to any connected micro:bit in the group. The name can\ninclude no more than 8 characters.", "radio.sendValue|param|name": "the field name (max 8 characters), eg: \"name\"", "radio.sendValue|param|value": "the numeric value", "radio.setFrequencyBand": "Change the transmission and reception band of the radio to the given channel", "radio.setFrequencyBand|param|band": "a frequency band in the range 0 - 83. Each step is 1MHz wide, based at 2400MHz.", "radio.setGroup": "Sets the group id for radio communications. A micro:bit can only listen to one group ID at any time.", "radio.setGroup|param|id": "the group id between ``0`` and ``255``, eg: 1", "radio.setTransmitPower": "Change the output power level of the transmitter to the given value.", "radio.setTransmitPower|param|power": "a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7", "radio.setTransmitSerialNumber": "Set the radio to transmit the serial number in each message.", "radio.setTransmitSerialNumber|param|transmit": "value indicating if the serial number is transmitted, eg: true" }