From 66d3c6c7e8859e08397838863547b00d65be062b Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 8 Dec 2016 08:28:28 -0800 Subject: [PATCH] fix for https://github.com/Microsoft/pxt/issues/549 --- docs/reference/serial/read-until.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/reference/serial/read-until.md diff --git a/docs/reference/serial/read-until.md b/docs/reference/serial/read-until.md new file mode 100644 index 00000000..4303b30b --- /dev/null +++ b/docs/reference/serial/read-until.md @@ -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)