I'm actually trying to display the maximum and the minimum temperature while my arduino uno is running :
For exemple if the actual temperature is 10°C and change to 9°C 1 minute later, i want my console show me : Minimum temperature : 9°C until it changes to another lower value and the same for the max temperature until it changes to an higher value
And here is my actual not working "script", the value don't wanna change !
I'm actually trying to display the maximum and the minimum temperature while my arduino uno is running :
For exemple if the actual temperature is 10°C and change to 9°C 1 minute later, i want my console show me : Minimum temperature : 9°C until it changes to another lower value and the same for the max temperature until it changes to an higher value
And here is my actual not working "script", the value don't wanna change ! Screenshot by Lightshot
Hope you understood !
Thanks !
you will need to make some of those variables persistent if you want to maintain their values each time loop() terminates.
BulldogLowell:
you will need to make some of those variables persistent if you want to maintain their values each time loop() terminates.
so read up on scope and the static keyword
Thank you for your fast answer!
I found the scope and it works fine for the Max Temperature, but not for the minimal temperature, because, i think the default value of the variable is 0, and i actually can't take it under 0°C.
But this is not what i want, i want to display the min temp. even when it's above 0