pxt-calliope/sim/state/thermometer.ts

18 lines
428 B
TypeScript
Raw Permalink Normal View History

2016-08-30 20:51:32 +02:00
namespace pxsim {
export class ThermometerState {
usesTemperature = false;
temperature = 21;
}
}
namespace pxsim.input {
export function temperature(): number {
let b = board();
if (!b.thermometerState.usesTemperature) {
b.thermometerState.usesTemperature = true;
runtime.queueDisplayUpdate();
}
return b.thermometerState.temperature;
}
}