Deprecating old radio APIs and fixing docs (#289)

This commit is contained in:
Richard Knoll
2016-10-24 16:30:21 -07:00
committed by Peli de Halleux
parent ba69563bf4
commit ec404e5887
25 changed files with 205 additions and 163 deletions

View File

@ -1,6 +1,7 @@
# Send String
Sends a string to other micro:bits in the area connected by radio.
Sends a string to other micro:bits in the area connected by radio. The
maximum string length is 19 characters.
```sig
radio.sendString("Hello!")
@ -10,9 +11,6 @@ radio.sendString("Hello!")
* `msg` is a [string](/reference/types/string) to send by radio.
### Simulator
This function only works on the micro:bit, not in browsers.
### Example: Two-way radio
@ -26,8 +24,8 @@ input.onButtonPressed(Button.A, () => {
basic.showString("SENT");
})
radio.onDataReceived(() => {
basic.showString(radio.receiveString());
radio.onDataPacketReceived(({ text }) => {
basic.showString(text);
});
```
@ -39,7 +37,7 @@ A radio that can both transmit and receive is called a _transceiver_.
### See also
[receive string](/reference/radio/receive-string), [on data received](/reference/radio/on-data-received)
[on data packet received](/reference/radio/on-data-packet-received)
```package
radio