added serial events
This commit is contained in:
@ -429,6 +429,11 @@ namespace pxsim.serial {
|
||||
export function readString(): string {
|
||||
return board().readSerial();
|
||||
}
|
||||
|
||||
export function onDataReceived(delimiters: string, handler: RefAction) {
|
||||
let b = board();
|
||||
b.bus.listen(DAL.MICROBIT_ID_SERIAL, DAL.MICROBIT_SERIAL_EVT_DELIM_MATCH, handler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user