LCD select menu function
Moderator: Benj
-
- Posts: 82
- Joined: Thu Nov 18, 2010 5:00 pm
- Has thanked: 52 times
- Been thanked: 5 times
- Contact:
LCD select menu function
Hi Team,
I am working on an embedded project, where the user highlights and selects options displayed on the LCD, wih the help of a rotory switch. I see that there is no read function on the LCD macro in V4. Can I have some ideas please!.
Can't see any previous links to the topic in the forum, will V5 have this function ?.
Thanks in advance.
Regards
Indana
I am working on an embedded project, where the user highlights and selects options displayed on the LCD, wih the help of a rotory switch. I see that there is no read function on the LCD macro in V4. Can I have some ideas please!.
Can't see any previous links to the topic in the forum, will V5 have this function ?.
Thanks in advance.
Regards
Indana
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: LCD select menu function
No read function has been made because reading back the data you sent to the LCD is useless .
Read the position of the rotary switch and do what you need to do when an option is selected .
Read the position of the rotary switch and do what you need to do when an option is selected .
-
- Posts: 82
- Joined: Thu Nov 18, 2010 5:00 pm
- Has thanked: 52 times
- Been thanked: 5 times
- Contact:
Re: LCD select menu function
Honestly it never occurred to me, good idea, but how do you select the menu options ?.
Sorry if I am being daft
regards
Indana
Sorry if I am being daft
regards
Indana
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: LCD select menu function
If you have a menu like this :
I would use 2 pushbuttons to move the cursor ('>') up and down.
Another pushbutton will work as the "enter button".
A rotary switch is just a switch with one (or more) input(s) and X output(s). This will require X I/O from the microcontroller.
And if the number of the outputs of the rotary switch is high, you'll need a lot of I/O and thus a "big" microcontroller.
(The '>' points the selected option in the menu)> menu 1
option
I would use 2 pushbuttons to move the cursor ('>') up and down.
Another pushbutton will work as the "enter button".
A rotary switch is just a switch with one (or more) input(s) and X output(s). This will require X I/O from the microcontroller.
And if the number of the outputs of the rotary switch is high, you'll need a lot of I/O and thus a "big" microcontroller.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LCD select menu function
Although that is true, I had a rotary switch with different values of resistors connected to each terminal of the switch.Spanish_dude wrote: A rotary switch is just a switch with one (or more) input(s) and X output(s). This will require X I/O from the microcontroller.
And if the number of the outputs of the rotary switch is high, you'll need a lot of I/O and thus a "big" microcontroller.
So when you turned the switch it was acting like a variable resistor, with set resistances.
I used just one pin of microcontroller, with a pull up value of 470K.
Switch was connected between one of microcontroller ADC i/p's and GND
As you rotate switch the resistance will change, hence changing the voltage at the ADC pin.
You can then use decision branches starting off with higher value and working its way down.
E.g If ADC>230 then display menu1
If ADC>200 then display menu2
If ADC>170 then display menu3
If ADC>140 then display menu4
etc.
But you need to place each decision as in picture below Not like this:
Martin
-
- Posts: 82
- Joined: Thu Nov 18, 2010 5:00 pm
- Has thanked: 52 times
- Been thanked: 5 times
- Contact:
Re: LCD select menu function
Brilliant
Thanks again Martin.
How do I highlight each menu option, with the help of a rotary switch?
I don't like the ">" symbol. Is there any other way, so that the whole menu option is highlighted
regards
Indana
Thanks again Martin.
How do I highlight each menu option, with the help of a rotary switch?
I don't like the ">" symbol. Is there any other way, so that the whole menu option is highlighted
regards
Indana
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LCD select menu function
What about if all the lines of menu are in lower case, then as you turn the switch one the selected menu line, changes from lower to upper case?
Or the selected menu line, right shifts by a place or 2?
Or the selected menu line can flash, whist rest of the menu lines are solid?
The idea Spanish_dude had of > is a very good one. Or use a # next to the selected menu line.
Martin
Or the selected menu line, right shifts by a place or 2?
Or the selected menu line can flash, whist rest of the menu lines are solid?
The idea Spanish_dude had of > is a very good one. Or use a # next to the selected menu line.
Martin
Martin
-
- Posts: 82
- Joined: Thu Nov 18, 2010 5:00 pm
- Has thanked: 52 times
- Been thanked: 5 times
- Contact:
Re: LCD select menu function
Posted a useful menu function as advised by Martin.
Helpful for others.
regards
Indana
Helpful for others.
regards
Indana
- Attachments
-
- LCD menu select.fcf
- (8.5 KiB) Downloaded 400 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LCD select menu function
That's Very good Indana!
I'm sure that routine will come in handy
Thanks for sharing.
I have just added some delays.
See what what you think?
I'm sure that routine will come in handy
Thanks for sharing.
I have just added some delays.
See what what you think?
- Attachments
-
- LCD menu select with Delay.fcf
- (8.5 KiB) Downloaded 415 times
Martin