pxt-calliope/sim/state/lightsensor.ts

10 lines
267 B
TypeScript
Raw Normal View History

2016-08-30 20:51:32 +02:00
namespace pxsim.input {
export function lightLevel(): number {
let b = board().lightSensorState;
if (!b.usesLightLevel) {
b.usesLightLevel = true;
runtime.queueDisplayUpdate();
}
return b.lightLevel;
}
}