View previous topic :: View next topic |
Author |
Message |
aodj
Joined: 20 Dec 2006 Posts: 40 Location: Reading, UK
|
Menu/UI |
Posted: Wed Jul 04, 2007 1:59 am |
|
|
I have a display comprised of a 3 character, 7 segment display. The UI i'm building into the product at the moment is based around a switch/case statement, where, by pressing a button, a value increments/decrements and so increases the value of the variable in the switch statement.
Is this the best way to craft a menu system, or does anyone else know of anything that has a smaller ROM footprint? |
|
|
inservi
Joined: 13 May 2007 Posts: 128
|
|
Posted: Tue Jul 10, 2007 2:57 am |
|
|
Hello,
I'm sorry to reply so later but i'm back from 1 week holiday.
You can make a very simple UI with 3 buttons and a display.
I often use this UI for applications. I use a loop in main procedure with a switch for 'modal' programing structure. That work well and it is easy to debug.
dro. _________________ in médio virtus |
|
|
aodj
Joined: 20 Dec 2006 Posts: 40 Location: Reading, UK
|
|
Posted: Wed Jul 11, 2007 1:38 am |
|
|
I don't understand what you mean by modal. The hardware for this menu I understand, it's simply the software that I'm having some concerns about, since my switch statement becomes quite elaborate, with each logical test.
Hence why I am wondering if anything else is more efficient. |
|
|
future
Joined: 14 May 2004 Posts: 330
|
|
|
aodj
Joined: 20 Dec 2006 Posts: 40 Location: Reading, UK
|
|
Posted: Wed Jul 11, 2007 7:59 am |
|
|
That code appears to be written to make use of an LCD. |
|
|
future
Joined: 14 May 2004 Posts: 330
|
|
Posted: Wed Jul 11, 2007 5:40 pm |
|
|
The way it does the output does not matter. Modify the lcd calls to your own display library.
Can you show strings on your display already?
If you are looking for a program that match exactly your needs I think you will wait forever. |
|
|
aodj
Joined: 20 Dec 2006 Posts: 40 Location: Reading, UK
|
|
Posted: Thu Jul 12, 2007 7:06 am |
|
|
Ok, let me explain.
As I said in my opening post, I have a 3 digit, 7 segment display. Now, I can display any number of characters to it, and have a working menu system that makes use of four push to make buttons, bound as "Next Menu", "Root Menu", "Increment" and "Decrement". I can pass both numbers and text to the display, and have 4 LED's additionally to display supplementary information on the status of 2 timers and 2 relays.
With me so far?
The menu system I have, is based around a switch examining a variable called vMenu, which, when "Next Menu" is pressed, increments, thus accessing the next entry in the switch and siplaying the corresponding menu.
This is reasonably ROM intensive, and I was wondering if anyone knew of a method which would reduce the amount of ROM that is being used. |
|
|
|