pxt-calliope/docs/reference/serial/read-string.md

28 lines
524 B
Markdown
Raw Normal View History

# Serial Read String
Read the buffered serial data as a string
```sig
serial.readString();
```
### Returns
2017-03-16 15:57:41 +01:00
* a [string](/types/string) containing input from the serial port. Empty if no data available.
### Example
The following program scrolls text on the screen as it arrives from serial.
```blocks
basic.forever(() => {
basic.showString(serial.readString());
});
```
### See also
[serial](/device/serial),
[serial write line](/reference/serial/write-line),
[serial write value](/reference/serial/write-value)