2.1.28, initiation update to PXT v5.28.24 (#54)

This commit is contained in:
Amerlander
2019-12-02 05:58:26 +01:00
committed by Peli de Halleux
parent 38a964516e
commit 5c114a0c57
1261 changed files with 50692 additions and 21604 deletions

View File

@@ -1,19 +1,24 @@
# Receive String
# receive String
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
Find the next string sent by `radio` from another @boardname@.
Find the next string sent by radio from another @boardname@.
```sig
radio.receiveString()
```
## ~ hint
### Returns
**Deprecated**
* the first [string](/reference/types/string) that was sent. If no
This API has been deprecated! Use [on received string](/reference/radio/on-received-string) instead.
## ~
## Returns
* the first [string](/types/string) that was sent. If no
string was sent, then this function returns an empty (blank) string.
### Example: Simple receiver
## Example: Simple receiver
Show the string sent by another @boardname@.
@@ -23,7 +28,7 @@ radio.onDataReceived(() => {
});
```
### Example: Two-way radio
## Example: Two-way radio
If you load this program onto two or more @boardname@s, you can send a code word from one of them to the others by pressing button `A`.
The other @boardname@s will receive the code word and then show it.
@@ -39,13 +44,13 @@ radio.onDataReceived(() => {
});
```
### ~hint
## ~hint
A radio that can both transmit and receive is called a _transceiver_.
### ~
## ~
### Example: Mood radio
## Example: Mood radio
This is a simple program to send whether you are happy or sad over ```radio```.
Use the `A` or `B` button to select an emotion.
@@ -84,7 +89,7 @@ radio.onDataReceived(() => {
});
```
### See also
## See also
[send string](/reference/radio/send-string), [on data received](/reference/radio/on-data-received)