added serial events

This commit is contained in:
Peli de Halleux committed 2016-05-17 09:36:01 -07:00
1 parent 7704ad9f8d
commit 2e3d875b7d
5 files changed
+58 -13

No files matched your search

+5
View File
@@ -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);
}
}