pxt-calliope/docs/reference/serial.md
Peli de Halleux 29de28a738
Added serial->write numbers to support CSV data generation (#699)
* support for serial write numbers

* moving down the list

* formatting

* fixing example typo
2018-03-08 08:33:02 -08:00

1.1 KiB

Serial

Read and write data over a serial connection.

serial.writeLine("");
serial.writeNumber(0);
serial.writeValue("x", 0);
serial.writeString("");
serial.writeNumbers([0]);
serial.readUntil(",");
serial.readLine();
serial.readString();
serial.onDataReceived(",", () => {})

Advanced

serial.redirect(SerialPin.P0, SerialPin.P0, BaudRate.BaudRate115200);
serial.redirectToUSB();
serial.writeBuffer(pins.createBuffer(0));
serial.readBuffer(64);

See Also

writeLine, writeNumber, writeValue, writeString, writeNumbers, readUntil, readLine, readString, onDataReceived, redirect, writeBuffer, readBuffer, redirectToUSB