Sunday 22 April 2012

Universal menu library for MCUs

I did a small cleaning in my menu routines and I was thinking, that it would be nice, if somone else could use it. Here it is! It's platform and lcd hardware independend. You have to define names of your own LCD routines in menu.h (lcdClear(), lcdString(str, x, y)).

Features:

  • Tested on AVRs ( incl. Arduino ) and ARMs
  • more after break...




Features:
  • Tested on AVRs ( incl. Arduino ) and ARMs
  • Needs just four keys: left, right, up, down
  • Works on character and graphical LCDs
  • Multilanguage
  • Simple configuration in file menu.h
  • Has also some optional number/temperature/time edit dialogs, but needs more tweaking
It's as easy as

static char *mainMenu[] = { "Menu title", "First item", "Second item", 0};

switch(showMenu(mainMenu))
{
 case 0:
     // First item selected
     break;
 case 1:
     // Second item selected
     break;
}

More on separate page with menu v1 project

No comments:

Post a Comment