pxt-calliope/docs/reference/serial/read-until.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR (#529)
* Accessibility changes
2017-09-07 13:42:08 -07:00

566 B

Serial Read Until

Read a text from the serial port until a delimiter is found.

serial.readUntil(",");

Returns

  • a string containing input from the serial port, such as a response typed by a user

Example

The following example reads strings separated by commands (,).

basic.forever(() => {
    let answer = serial.readUntil(",");
    serial.writeLine(answer);
});

See also

serial, serial write line, serial write value