IIC added (#870)

* IIC added

* Fixed bug with not detecting device
This commit is contained in:
Max
2019-08-28 03:57:21 +03:00
committed by Peli de Halleux
parent fb255edafe
commit db9b6a995b
2 changed files with 186 additions and 8 deletions

View File

@ -27,6 +27,7 @@ namespace pxsim.sensors {
export function __sensorUsed(port: number, type: number) {
//console.log("SENSOR INIT " + port + ", type: " + type);
if (type == DAL.DEVICE_TYPE_IIC_UNKNOWN) return; // Ignore IIC
if (!ev3board().hasSensor(port)) {
const sensor = ev3board().getSensor(port, type);
runtime.queueDisplayUpdate();