Arduino based incubator - hangs - SOLVED - power supply issues

PaulS:

  if(curMillis - windowStartTime>windowSize)  windowStartTime += windowSize;

Adding time variables is a bad idea.

But that's adding an interval to a timestamp to get a new later timestamp, nothing wrong with that at all.