Control event value in simulator (#343)
* implement pxsim.control.eventValue and pxsim.control.eventTimestamp in the simulator
This commit is contained in:
parent
e15da5dee1
commit
00f4c9cbb3
@ -36,6 +36,6 @@
|
|||||||
"semantic-ui-less": "^2.2.4"
|
"semantic-ui-less": "^2.2.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pxt-core": "0.10.4"
|
"pxt-core": "0.10.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,14 @@ namespace pxsim.control {
|
|||||||
// TODO mode?
|
// TODO mode?
|
||||||
board().bus.queue(id, evid)
|
board().bus.queue(id, evid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function eventValue(): number | string {
|
||||||
|
return board().bus.getLastEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
export function eventTimestamp(): number {
|
||||||
|
return board().bus.getLastEventTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace pxsim.pxtcore {
|
namespace pxsim.pxtcore {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user