pxt-calliope/docs/reference/serial.md
Galen Nickel aee9b84b31
Do some edits for serial redirect ()
* Do some edits for serial redirect

* Broken links
2017-12-15 16:46:16 -08:00

1014 B

Serial

Read and write data over a serial connection.

serial.writeLine("");
serial.writeNumber(0);
serial.writeValue("x", 0);
serial.writeString("");
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, readUntil, readLine, readString, onDataReceived, redirect, writeBuffer, readBuffer, redirectToUSB