write Number
Write a number to the serial port.
serial.writeNumber(0)
A number value is written to the serial port as characters in a string representation. The number 876, for example:
serial.writeNumber(876)
The receiving serial port will see this number as the 3 characters:
876Parameters
valueis the number to write to the serial port
Examples
One, Two, Three
This program repeatedly writes a 3-digit number as a line to the serial port.
basic.forever(function() {
serial.writeNumber(123)
serial.writeLine("")
basic.pause(5000)
});
Plot bar graph does serial
If you use the led.plotBarGraph function, it writes the number
being plotted to the serial port too.
basic.forever(function() {
led.plotBarGraph(input.lightLevel(), 255)
basic.pause(10000)
})