695 B
695 B
Write Line
Writes a string and a new line character (\r\n
) to serial.
serial.writeLine("");
Example: streaming data
The following example constantly checks the compass heading and sends the direction to serial.
basic.forever(() => {
let heading = input.compassHeading()
if (heading < 45) {
serial.writeLine("N");
} else if (heading < 135) {
serial.writeLine("E");
}
else if (heading < 225) {
serial.writeLine("S");
}
else {
serial.writeLine("W");
}
})