pxt-calliope/docs/reference/serial/read-string.md
2017-03-16 07:57:41 -07:00

524 B

Serial Read String

Read the buffered serial data as a string

serial.readString();

Returns

  • a 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.

basic.forever(() => {
    basic.showString(serial.readString());
});

See also

serial, serial write line, serial write value