Rename the parameters for the sendValue block (#293)
This commit is contained in:
parent
f2e1bc0168
commit
95e4c609a4
@ -4,7 +4,7 @@ Communicate data using radio packets
|
|||||||
|
|
||||||
```cards
|
```cards
|
||||||
radio.sendNumber(0);
|
radio.sendNumber(0);
|
||||||
radio.sendValue("data", 0);
|
radio.sendValue("name", 0);
|
||||||
radio.sendString("");
|
radio.sendString("");
|
||||||
radio.onDataPacketReceived(() => {
|
radio.onDataPacketReceived(() => {
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ Send a [string]() and [number]() together by ``radio`` to other micro:bits.
|
|||||||
The maximum [string]() length is 12 characters.
|
The maximum [string]() length is 12 characters.
|
||||||
|
|
||||||
```sig
|
```sig
|
||||||
radio.sendValue("data", 0);
|
radio.sendValue("name", 0);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
@ -188,7 +188,7 @@ namespace radio {
|
|||||||
/**
|
/**
|
||||||
* Broadcasts a name / value pair along with the device serial number
|
* Broadcasts a name / value pair along with the device serial number
|
||||||
* and running time to any connected micro:bit in the group.
|
* and running time to any connected micro:bit in the group.
|
||||||
* @param name the field name (max 12 characters), eg: "data"
|
* @param name the field name (max 12 characters), eg: "name"
|
||||||
* @param value the numberic value
|
* @param value the numberic value
|
||||||
*/
|
*/
|
||||||
//% help=radio/send-value
|
//% help=radio/send-value
|
||||||
|
@ -35,7 +35,7 @@ namespace radio {
|
|||||||
//% help=radio/on-data-packet-received
|
//% help=radio/on-data-packet-received
|
||||||
//% mutate=true
|
//% mutate=true
|
||||||
//% mutateText=Packet
|
//% mutateText=Packet
|
||||||
//% mutateDefaults="receivedNumber;receivedString,receivedNumber;receivedString"
|
//% mutateDefaults="receivedNumber;receivedString:name,receivedNumber:value;receivedString"
|
||||||
//% blockId=radio_on_packet block="on radio received" blockGap=8
|
//% blockId=radio_on_packet block="on radio received" blockGap=8
|
||||||
export function onDataPacketReceived(cb: (packet: Packet) => void) {
|
export function onDataPacketReceived(cb: (packet: Packet) => void) {
|
||||||
onDataReceived(() => {
|
onDataReceived(() => {
|
||||||
|
2
libs/radio/shims.d.ts
vendored
2
libs/radio/shims.d.ts
vendored
@ -16,7 +16,7 @@ declare namespace radio {
|
|||||||
/**
|
/**
|
||||||
* Broadcasts a name / value pair along with the device serial number
|
* Broadcasts a name / value pair along with the device serial number
|
||||||
* and running time to any connected micro:bit in the group.
|
* and running time to any connected micro:bit in the group.
|
||||||
* @param name the field name (max 12 characters), eg: "data"
|
* @param name the field name (max 12 characters), eg: "name"
|
||||||
* @param value the numberic value
|
* @param value the numberic value
|
||||||
*/
|
*/
|
||||||
//% help=radio/send-value
|
//% help=radio/send-value
|
||||||
|
Loading…
Reference in New Issue
Block a user