Hi , i made a simple thermometer using LM35 and LCD to show the temp but i want to show the min and max temp also and i don't have an idea can you help me ? here is the code
You must have SOME idea. After all, it isn't rocket science to determine if this value is more than that value. If it is, that value isn't the max. This value is.
It isn't rocket science to determine if this value is less than that value. If it is, that value isn't the min. This one is.
PaulS:
You must have SOME idea. After all, it isn't rocket science to determine if this value is more than that value. If it is, that value isn't the max. This value is.
It isn't rocket science to determine if this value is less than that value. If it is, that value isn't the min. This one is.
Thanks for you reply i tried to did what you said the max value works fine but the min value keep showing 0 only the lm35 reading is between 20 and 30 here is what i did
int tempC ;
int maxtemp ;
int mintemp ;
if (tempC > maxtemp) maxtemp = tempC ;
if (tempC < mintemp) mintemp = tempC ;
If you declared minTemp and maxTemp as global variables, then they got initialized to 0. So, no temp was lower than that, so the code correctly pointed that out.
Give minTemp and maxTemp unreasonable initial values.