• AVR Freaks

scroll down multilevel lcd menu

Author
EdoMax
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2009/09/07 12:04:44
  • Location: 0
  • Status: offline
2009/09/21 09:50:21 (permalink)
0

scroll down multilevel lcd menu

I am in progress of making LCD multilevel menu.Something like this:
MM stands for Main Menu and _sub is sub menu of main menu.
Is there any code example on such things ?

As far as i can tell i should implement some timer and array to cycle threw menu.
The LCD menu messages will always be choosed with one button press in down direction. 

static enum states{
   MMLine3,
   MMLine2
   MMLine1,
};

enum events{
   MMLine3_sub,
   MMLine2_sub
   MMLine1_sub,
};


static unsigned char state;

static void MMLine3_EventHandler(unsigned char event);
static void MMLine2_EventHandler(unsigned char event);
static void MMLine1_EventHandler(unsigned char event);

static void ChangeState(unsigned char newState)
{
   state=newState;
}


static void MMLine3_EventHandler(unsigned char event)
{
   switch(event)
   {
      case MMLine3_sub:
         break;
      case MMLine2_sub:
         break;
      case MMLine1_sub:
         ChangeState(MMLine1);
         break;
   }
}

static void MMLine2_EventHandler(unsigned char event)
{
   switch(event)
   {
      case MMLine3_sub:
         break;
      case MMLine2_sub:
         break;
      case MMLine1_sub:
         break;
   }
}

static void MMLine1_EventHandler(unsigned char event)
{
   switch(event)
   {
      case MMLine3_sub:
         break;
      case MMLine2_sub:
         break;
      case MMLine1_sub:
         break;
   }
}

//--- main thing
void GlobalEventHandler(unsigned char event)
{
   switch(state)
   {
      case MMLine3: MMLine3_EventHandler(event);
         break;
      case MMLine2: MMLine2_EventHandler(event);
         break;
      case MMLine1: MMLine1_EventHandler(event);
         break;
   }
} //-------------------------------------------------
Edo
#1

3 Replies Related Threads

    Neiwiertz
    Super Member
    • Total Posts : 2094
    • Reward points : 0
    • Joined: 2004/09/01 02:58:52
    • Status: offline
    RE: scroll down multilevel lcd menu 2009/09/22 10:29:37 (permalink)
    0
    Recently there was posted example(s) to create menu system i have just updated them at the E16 gallery and added yours one aswell, check these helpfull reference links

    How to impliment a menu system in LCD?

    Menu driven AN in C

    E16 Interfacing: Graphics PICtail Plus Daughter Board 2

    Flying With --|Explorer 16|HardWare|SoftWare|-- Fav(s) Gallery Lists
    #2
    EdoMax
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2009/09/07 12:04:44
    • Location: 0
    • Status: offline
    RE: scroll down multilevel lcd menu 2009/09/24 02:01:04 (permalink)
    0
    It very nice that you ( and others ) collect such "database" of examples and solutions.

    Back to my case...
    The examples one and two are huge !.
    So much code for something like this :-).

    I am using 2x16 LCD so this should partly simplify the whole process.
    If you agree, i think it would be the best to start with some basic menu/submenu system for such display.
    This example should be of general help to others.

    Can we base this code example on the idea that i have send or do you have some other example ?
    It would be best is we can go step by step, so that this topic would be real help to us.

    Edo

    #3
    Neiwiertz
    Super Member
    • Total Posts : 2094
    • Reward points : 0
    • Joined: 2004/09/01 02:58:52
    • Status: offline
    RE: scroll down multilevel lcd menu 2009/09/27 05:31:54 (permalink)
    0
    Yeah that's a good and learnfull approach to get started trying to create your idea of a basic display menu example for a 2x16
    (or even more lines). Your idea looks like on a possible base for such system but in a first glance i think it need to be enhanced. 
     
    Is it an idea to have a look at http://reifel.org/PICUserInterface/ base to learn from, or at Microchip Graphics stack to get an idea how a base could being setup.

    Flying With --|Explorer 16|HardWare|SoftWare|-- Fav(s) Gallery Lists
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5