Deprecating old radio APIs and fixing docs (#289)
This commit is contained in:
committed by
Peli de Halleux
parent
ba69563bf4
commit
ec404e5887
@ -1,6 +1,7 @@
|
||||
# Send Value
|
||||
|
||||
Send a [string]() and [number]() together by ``radio`` to other micro:bits.
|
||||
The maximum [string]() length is 12 characters.
|
||||
|
||||
```sig
|
||||
radio.sendValue("data", 0);
|
||||
@ -11,10 +12,6 @@ radio.sendValue("data", 0);
|
||||
* ``name`` is a [string](/reference/types/string) to send by radio
|
||||
* ``value`` a [number](/reference/types/number) to send by radio
|
||||
|
||||
### Simulator
|
||||
|
||||
This function only works on the micro:bit, not in browsers.
|
||||
|
||||
### Example: Broadcasting acceleration
|
||||
|
||||
This program sends your micro:bit's **acceleration** (amount it is
|
||||
@ -34,15 +31,15 @@ Then it shows them on the LED screen.
|
||||
|
||||
```blocks
|
||||
radio.setGroup(99)
|
||||
radio.onDataReceived(() => {
|
||||
basic.showString(radio.receiveString());
|
||||
basic.showNumber(radio.receiveNumber());
|
||||
radio.onDataPacketReceived(({ text, receivedNumber }) => {
|
||||
basic.showString(text);
|
||||
basic.showNumber(receivedNumber);
|
||||
});
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[receive number](/reference/radio/receive-number), [on data received](/reference/radio/on-data-received)
|
||||
[on data packet received](/reference/radio/on-data-packet-received)
|
||||
|
||||
```package
|
||||
radio
|
||||
|
Reference in New Issue
Block a user