2017-07-11 10:15:17 +02:00
|
|
|
namespace pxsim {
|
|
|
|
|
|
|
|
export class EV3LightState {
|
|
|
|
lightPattern: number;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
this.lightPattern = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace pxsim.output {
|
|
|
|
|
2017-07-12 09:25:17 +02:00
|
|
|
export function setLights(pattern: number) {
|
2017-12-19 23:20:35 +01:00
|
|
|
const brickState = ev3board().getBrickNode();
|
|
|
|
const lightState = brickState.lightState;
|
2017-12-19 23:57:28 +01:00
|
|
|
if (lightState.lightPattern != pattern) {
|
|
|
|
lightState.lightPattern = pattern;
|
|
|
|
brickState.setChangedState();
|
|
|
|
}
|
2017-07-11 10:15:17 +02:00
|
|
|
}
|
|
|
|
}
|