pxt-calliope/sim/state/lightsensor.ts
2016-09-09 22:56:26 -07:00

10 lines
267 B
TypeScript

namespace pxsim.input {
export function lightLevel(): number {
let b = board().lightSensorState;
if (!b.usesLightLevel) {
b.usesLightLevel = true;
runtime.queueDisplayUpdate();
}
return b.lightLevel;
}
}