This commit is contained in:
Peli de Halleux 2016-12-08 08:28:28 -08:00
parent 7f27432222
commit 66d3c6c7e8

View File

@ -0,0 +1,28 @@
# Serial Read Until
Read a text from the serial port until a delimiter is found.
```sig
serial.readUntil(",");
```
### Returns
* a [string](/reference/types/string) containing input from the serial port, such as a response typed by a user
### Example
The following example reads strings separated by commands (``,``).
```blocks
basic.forever(() => {
let answer = serial.readUntil(",");
serial.writeLine(answer);
});
```
### See also
[serial](/device/serial),
[serial write line](/reference/serial/write-line),
[serial write value](/reference/serial/write-value)