3 ms·
> you are assuming that the line that says 'wait' is a busy loop I wasn't asking if the "wait" was a busy loop, I was asking if the "check whether the temperat
by war1025 6y ago
> you are assuming that the line that says 'wait' is a busy loop
I wasn't asking if the "wait" was a busy loop, I was asking if the "check whether the temperature dropped too far" was evaluated in a busy loop, and if not, how often that condition was checked.
It doesn't really matter, and I imagine I won't get a response at this point, but it was just something I was curious about since I had never considered writing your own home thermostat software.
- labawi 6y agoI believe it uses sleep, and either threads or events / interrupts. I don't remember which. It's programmed in micropython. It calculates medians for each minute, and from those a 5-minute median (which is only considered valid if a majority of values are present) to filter out things like opening doors and missing values. Temperature readings are transported wirelessly from a different room. It supports multiple temperature clients for multiple rooms, each with a preset minimum (heat cycle activating) temperature, and also a maximum (safety-shutoff => don't activate heating) temperature.
- CyberDildonics 6y agoIt could be done with interrupts. With something like a raspberry pi it could be done with thread sleeps that yield non trivial amounts of process time so that the CPU usage is low.