Hi, I made a simple thermometer with LCD using this tutorial Make an Arduino Temperature Sensor (Thermistor Tutorial) . Works fine, but i want to show max and min temperature in the second line of the LCD. I guess I should read the last temp. value, and compare this with new reading from thermistor using function if. I wrote some code, but it doesn't work properly. Could somebody help me?
I guess I should read the last temp. value, and compare this with new reading from thermistor using function if.
No
You need 2 variables. Let's name them highestTemp and lowestTemp. Set them initially to impossibly low and impossibly high values respectively. When you have read the current temperature compare it with highestTemp. If the current temp is greater than highestTemp then set highestTemp to the current temp, Similarly compare lowestTemp to the current temp. If the current temp is lower than lowestTemp then set lowestTemp to the current temp.
Now display the values. For extra efficiency only display the values if they have changed.
For now, I am just trying to read max value. I think I'm doing exactly what you said, but it still isn't working. Second line on the lcd shows last reading from the first line (for example 21.20 > 21.12/21.20 > 21.40/21.12...). Could you look at the sketch ?