Doesn't stay at other screen unless button keeps being pressed

Hi everyone

I have to make an arduino project for school and my project is that you can read the temperature of the room on an lcd screen. When it's a good temperature, so not too hot or cold, a yellow led burns. When the temperature is too hot a red led burns and when it's too cold a blue led burns. Also when it's too cold/hot a buzzer goes off. You can also change the minimum and maximum temperature when it's too cold or hot for your taste.

And there lies the problem.

On my first screen you can see the min temp and can change it, but in order to change the max temp you have to press a button. The problem is that you only see the screen(so the one with the max temperature) when the button is being pressed. Once you let go of it, the screen changes back to min.

My question is, how do I make sure that it stays at the max screen when I press the button and then make it go back by pressing the button again?

if(digitalRead(right_key)==HIGH) is what I worked with to use my buttons.

Thnx so much already :slight_smile:

Huh?

I don't see anything.

Hi EPIC878, welcome.

Show your code so we know what you're talking about.

So now we'll have to guess:

You need to remember the button was pressed (once or an odd number of times) , and also to not show the other screen while the button was pressed (same).
That's part of the exercise you are trying to do.
See my signoff message below ?

Here is my code :slight_smile:

Thermometer.ino (2.99 KB)

Thanks for your code.

The answer is in my last reply.

Veel succes met je school opdracht.