2018-07-09 20:17:32 +02:00
# on Received String
Run part of a program when the @boardname @ receives a [string ](/types/string ) over ``radio``.
```sig
radio.onReceivedString(function (receivedString) {})
```
## Parameters
* **receivedString**: The [string ](/types/string ) that was sent in this packet or the empty string if this packet did not contain a string. See [send string ](/reference/radio/send-string ) and [send value ](/reference/radio/send-value )
2019-03-11 23:04:38 +01:00
## ~ hint
Watch this video to see how the radio hardware works on the @boardname@:
https://www.youtube.com/watch?v=Re3H2ISfQE8
## ~
2018-07-09 20:17:32 +02:00
## Example
This program continuously sends a cheerful message. It also receives a messages from nearby @boardname@s . It shows these messages on the screen.
```blocks
basic.forever(() => {
radio.sendString("I'm happy");
})
radio.onReceivedString(function (receivedString) {
basic.showString(receivedString)
})
```
## Troubleshooting
The ``||radio:on received string||`` event can only be created once, due to the hardware restrictions.
2018-10-16 19:20:05 +02:00
The radio set group might need to be set, synchronized, before the radio events will function.
2018-07-09 20:17:32 +02:00
## See also
[on received number ](/reference/radio/on-received-number ),
2019-02-14 06:01:50 +01:00
[received packet ](/reference/radio/received-packet ),
2018-07-09 20:17:32 +02:00
[send number ](/reference/radio/send-number ),
[send string ](/reference/radio/send-string ),
[send value ](/reference/radio/send-value ),
[set group ](/reference/radio/set-group )
```package
radio
```