Menus on the Parallax 4X20 Serial LCD Screen.
Doc54963
Posts: 1
Hi Everyone,
Please forgive my ignorance but I just started to program. Also thanks in advance for all your help.
My first real project uses the Parallax 4X20 Serial LCD screen (Found Here) for operation selection and data Input. The initial menu of the project will allow the selection of different "operations". Once selected a sub-menu the user will be prompted to enter parameters needed for this operation.
Ideally I would like to user a Special Character as a pointer that will move down the list until it reaches line 4. At that point it will move to the next page and the pointer will go back to line 1. At that point the process will start over again. These movements will be controlled by 5 buttons (L, R, Up, Dwn, Enter).
Once in a sub-menu I would like Previous operation name be the determinant heading allowing lines 2-4 to be for data input.
I would love to get some input form the community about how I would go about programing such Menus for the prop.
Thank You
Leonard
Please forgive my ignorance but I just started to program. Also thanks in advance for all your help.
My first real project uses the Parallax 4X20 Serial LCD screen (Found Here) for operation selection and data Input. The initial menu of the project will allow the selection of different "operations". Once selected a sub-menu the user will be prompted to enter parameters needed for this operation.
Ideally I would like to user a Special Character as a pointer that will move down the list until it reaches line 4. At that point it will move to the next page and the pointer will go back to line 1. At that point the process will start over again. These movements will be controlled by 5 buttons (L, R, Up, Dwn, Enter).
Once in a sub-menu I would like Previous operation name be the determinant heading allowing lines 2-4 to be for data input.
I would love to get some input form the community about how I would go about programing such Menus for the prop.
Thank You
Leonard
Comments
To implement a scrolling cursor type of interface (which is not demonstrated in this code), all you need to do is repeatedly modify the last character of each row. This would be pretty easy to accomplish in a "for y = 0 to 3" loop. You would move the cursor to the last colum of line one, place the char, pause, replace that char with a space, move to the last column of the next row, place the car, pause..... during the pause, check for a button push. if the button was pushed during that time use the value of y as your selection result.
That type of approach would work best in less demanding applications and is not meant to be efficient, but it is simple, and would get the job done... The attached is only slightly more sophisticated than that.
Might be time to dust this sid project off... great there goes the next few hours
Attached is code for the 4x20 LCD and 4 buttons (Up, Down, Select, Escape) that scrolls thru main menu, then the selected submenu, etc.
Menus will scroll on the screen with a prompt at the current menu. I removed a cog that deals with proprietary code, but this should start you off.
mojorizing- I was wanting to play with your code. I can't get it to do anything other than display the initial screen. I have it running on a PPDB using the pin assignments described in your code. I have the 4 buttons mentioned in your object (Btn_Up, Btn_Down, Btn_Select and Btn_Escape) connected to 4 push buttons on the PPDB on P11 - P14. They are tied high and pulled low when pressed. Is this the way your code interprets them?
Thanks.
Don
no...all are tied low, pulled high on button pushed
Your code is fairly advanced for me to follow so I have trouble figuring it out but I want to learn from it. Any suggestions as to what might be wrong?
Thanks.
Don
I cut too much code out of my first example - the "UPDATES_LCD" OBJECT should be repeating...and updating as buttons are pushed.
Try this example
Thanks.
What's not show is somewhat proprietary....basically, when you press "select", the code will know where the prompt is, what the user has selected, and what to do from there.
There's also an article on a menu system here>>
http://www.parallaxsemiconductor.com/an013
I never really got a good understanding of it, but it's worth a read.
I dug this setup out again today to play with and figured out why it did not go into the submenu.
In the Button_Push method change this:
to:
Hope this helps anyone else playing with this code example.