adwsystems:
Along those lines, what is the result of the adc conversion formula tempC = reading / 9.31; that is float = int / float?I avoid problems like this so I don't have to remember all the nuances.
a float.
and then
if ( float < 21 )
I'd use the read to work with directly. It's faster and easier, takes less code and RAM.
Turning it into more digits does not improve the accuracy. Only convert to show to humans.
PS: AVR datasheet, ADC Absolute Accuracy is +/- 2 LSB's. The read can be off +/- 2.