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,18 +1,25 @@
# Send String
# send String
Sends a string to other @boardname@s in the area connected by radio. The
maximum string length is 19 characters.
```sig
radio.sendString("Hello!")
radio.sendString("hi!")
```
### Parameters
## Parameters
* `msg` is a [string](/reference/types/string) to send by radio.
* **msg**: a [string](/types/string) to send by radio.
## ~ hint
### Example: Two-way radio
Watch this video to see how the radio hardware works on the @boardname@:
https://www.youtube.com/watch?v=Re3H2ISfQE8
## ~
## 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
@@ -23,21 +30,20 @@ input.onButtonPressed(Button.A, () => {
radio.sendString("Codeword: TRIMARAN")
basic.showString("SENT");
})
radio.onDataPacketReceived(({ receivedString }) => {
radio.onReceivedString(function (receivedString) {
basic.showString(receivedString);
});
})
```
### ~hint
## ~hint
A radio that can both transmit and receive is called a _transceiver_.
### ~
## ~
### See also
## See also
[on data packet received](/reference/radio/on-data-packet-received)
[on received string](/reference/radio/on-received-string)
```package
radio