radio blocks to read/stream value pairs
This commit is contained in:
19
libs/microbit-radio/shims.d.ts
vendored
19
libs/microbit-radio/shims.d.ts
vendored
@@ -13,6 +13,25 @@ declare namespace radio {
|
||||
//% blockId=radio_datagram_send_numbers block="send numbers|0: %VALUE0|1: %VALUE1|2: %VALUE2|3: %VALUE3" shim=radio::sendNumbers
|
||||
function sendNumbers(value_0: number, value_1: number, value_2: number, value_3: number): void;
|
||||
|
||||
/**
|
||||
* Broadcasts a name / value pair along with the device serial number
|
||||
* and running time to any connected BBC micro:bit in the group.
|
||||
* @param name the field name (max 12 characters), eg: "data"
|
||||
* @param the numberic value
|
||||
*/
|
||||
//% help=radio/stream-value
|
||||
//% weight=15
|
||||
//% blockId=radio_datagram_stream_value block="stream|value %name|= %value" shim=radio::streamValue
|
||||
function streamValue(name: string, number: number): void;
|
||||
|
||||
/**
|
||||
* Reads a value sent with `stream value` and writes it
|
||||
* to the serial stream as JSON
|
||||
*/
|
||||
//% help=radio/read-value-to-serial
|
||||
//% weight=14 shim=radio::readValueToSerial
|
||||
function readValueToSerial(): void;
|
||||
|
||||
/**
|
||||
* Registers code to run when a packet is received over radio.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user