I implemented project 03 (love-o-meter) but the value measured by the sensor varies between 144 and 146, that means 0 volts and a temperature of -50.00 degrees.
The formula for the voltage should be;
Voltage = (sensor / 1024) X 5.0
So if you had a sensor value of 145 then it should be (145/1024) X 5 = 0.71 volts, not 0 volts.
Thank you, hiduino!
Do you know what? I calculated Voltage by multiplying to 0.5 instead of 5.0
Adjusting the multiplication factor, it works fine.
Just a short note: if I write "Voltage = (sensor /1024) * 5.0", Voltage is calculated as 0.00; instead, if I write "Voltage = (sensor /1024.0) * 5.0", the result is correct (not zero).
Do I need to write any number using at least a decimal place after point?
But this is not really a problem for me: probably, a better knowledge of this specific coding language could help me in avoiding this kind of mistakes.