I am making my first project with an LCD display.
I created a scroll menu that shows different screens every time you press the scroll up or down button. However, sinse the program runs over and over all the time, the arduino refreshes the state the LCD should be in all the time. I believe this is what is causing the flashing. What I want to know: is there a way to ckeck the state it should be in only when I press the button, and not over and over all the time?
As you can see the value is increased and decreased according to the buttons you press, and if you reach the end of the menu, it will start from the other side(creating an infinite loop of scrolling through the menu) I use a switch...case to show the menu corresponding to the menu value. But now it reads that value over and over again causing it to flash, instead of just checking it when I want to change menu screens...
Some help would be greatly appreciated
Thanks in advance
Sean
When I see the term 'flickering' or 'flashing' associated with 'LCD' in the title of a post I immediately look for an lcd.clear() statement in loop(). Guess what ... I found one here.
It is typically possible to achieve the desired result without the use of lcd.clear() since any new data will overwrite the old. You may have to do some selective erasing by writing 'spaces' but it is seldom necessary to erase the entire screen.
ALSO - go back and edit your original post to put your code in a 'code box'. The forum instructions (you did read them didn't you) have instructions on how to do this.
So now I changed it so it checks to see if the val is different than before, before clearing and re-writing the LCD. It works great! the only problem is that now it displays an infinity sign before the degrees C. Any advice?
The "°" sign you used is the degree sign for your computer, not the one for your LCD. On the computer, it is two bytes. For your LCD I think it needs to be char(0x83) so you need to use
lcd.setCursor(5, 1);
lcd.write(char(0x83),"C");
But you really do not need to set the cursor for every piece of the text.
Oh, and please go back to your first post above and mark up the code properly.
Bummer, since there is no way to know what font ROM the LCD device has.
To avoid any issues from potentially different front ROMs, a custom character could be defined.
It could even have the degree symbol and the units character in the same single custom character.
i.e.