LCD select menu function

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

LCD select menu function

Post by nmindana »

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

Spanish_dude
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

Post by Spanish_dude »

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 :).

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: LCD select menu function

Post by nmindana »

Honestly it never occurred to me, good idea, but how do you select the menu options ?.

Sorry if I am being daft :wink:

regards

Indana

Spanish_dude
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

Post by Spanish_dude »

If you have a menu like this :
> menu 1
option
(The '>' points the selected option in the menu)

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.

medelec35
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

Post by medelec35 »

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.
Although that is true, I had a rotary switch with different values of resistors connected to each terminal of the switch.
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
Right way
Right way
Menu Select.jpg (231.8 KiB) Viewed 7688 times
Not like this:
Wrong way
Wrong way
Menu Select2.jpg (121.51 KiB) Viewed 7688 times
Martin

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: LCD select menu function

Post by nmindana »

Brilliant :D

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

medelec35
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

Post by medelec35 »

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
Martin

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: LCD select menu function

Post by nmindana »

Posted a useful menu function as advised by Martin.
Helpful for others.

regards

Indana
Attachments
LCD menu select.fcf
(8.5 KiB) Downloaded 400 times

medelec35
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

Post by medelec35 »

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?
Attachments
LCD menu select with Delay.fcf
(8.5 KiB) Downloaded 415 times
Martin

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: LCD select menu function

Post by nmindana »

Works much better.

Thanks :)

Post Reply