Serial On Data Received

Registers an event to be fired when one of the delimiter is matched.

serial.onDataReceived(",", () => {})

Parameters

Example

Read values separated by ,:

serial.onDataReceived(serial.delimiters(Delimiters.Comma), () => {
    basic.showString(serial.readUntil(serial.delimiters(Delimiters.Comma)))
})

See also

serial, serial write line, serial write value

Edit this page on GitHub