added serial events
This commit is contained in:
1 parent
7704ad9f8d
commit
2e3d875b7d
5 files changed
+58
-13
No files matched your search
@@ -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