pxt-calliope/docs/reference/serial.md
Peli de Halleux d4220593b0 Serial events (#337)
* added "serial->on data received"

* updated info

* updated docs

* added readline to read entire buffer

* lazy initialize of serial buffers

* init async on event

* updated docs
2017-01-22 17:08:59 -08:00

20 lines
621 B
Markdown

# Serial
Reading and writing data over a serial connection.
```cards
serial.writeLine("");
serial.writeNumber(0);
serial.writeValue("x", 0);
serial.writeString("");
serial.readUntil(",");
serial.readLine();
serial.readString();
serial.redirect(SerialPin.P0, SerialPin.P0, BaudRate.BaudRate115200);
serial.onDataReceived(",", () => {})
```
### See Also
[writeLine](/reference/serial/write-line), [writeNumber](/reference/serial/write-number), [writeValue](/reference/serial/write-value), [writeString](/reference/serial/write-string), [readLine](/reference/serial/read-line), [redirect](/reference/serial/redirect-to)