what do you think about this algorithm?
Yuck.
OMG, did I say that.

If all those fans, heaters, etc. are individually controlled?
You'd get much better results using a PID loop or two.

Then it would be able to actively "Maintain" the preset conditions, instead of just overreacting when things get too far out of whack.

Check out this thread from Henrick.

PID-filter routine (2nd try).
http://www.picbasic.co.uk/forum/showthread.php?t=5874

And this explains how it works.
It's for the basic stamp, but it's what henrick based his program on.
Start at page 97

Industrial Control (pdf)
http://www.parallax.com/Portals/0/Do...oks/edu/ic.pdf
<br>