Thanks.TedO wrote:By the way, your MPC9701 thermometer works very well
If you prefer that sensor I can incorporate within your application.
Reason why you Flowchart is not working when you add in your case:
Code: Select all
Temp = Temp * 49 / 10
Reason it makes a difference is because when GetInt is used along with Temp = Temp * 49 / 10 then the temperature result will be temperature * 10
for example if room is 20deg C, since LM35 has 10mV per C output then Vout = 0.01 * 20 = 0.2V
ADC for 0.2V is 1024/5*0.2 = 41
Therefore after the formula Temp = Temp * 49 / 10
When Temp = 41
Temp = 41 * 49 / 10 = 200 = 20.0 degC
I have modded your flowchart to give the extra decimal point, but done it without the complexity of the strings so I actually prefer it this way.
That can easily be removed if necessary.
Martin