Help with lcd menu library/program

Hi everyone, I have been trying to find a simple and easy to use menu and library that can be easily adapted to different projects but all the ones I have found don't quite match my needs. I am a somewhat novice programmer but have taken a couple classes in c code for my mechanical engineering program.

The menu system I would like to create would have the following parameters: -16x2 Serial LCD with 4 buttons (menu,enter,up,down) -A main display that will display readings from various sensors -A menu with submenus -Being able to change parameters/variables and save to eeprom

Here is a bit of what I am trying to accomplish,

Main Menu{ -Stage 1 -Stage 2 -Display -Screen Settings } Sub menus: Stage 1{ -Start PSI -Full PSI } Stage 2{ -Start PSI -Full PSI }

etc...

Would I be able to use structs to accomplish this or how should I go about doing this?

I wrote a menu that keeps track of button bushes etc to navigate but takes up half the space on the chip which doesn't leave much for actual project code.

Any help would be appreciated and I will post the finished code/library so everyone can use it!

mitchedwards: Hi everyone, I have been trying to find a simple and easy to use menu and library that can be easily adapted to different projects but all the ones I have found don't quite match my needs. I am a somewhat novice programmer but have taken a couple classes in c code for my mechanical engineering program.

The menu system I would like to create would have the following parameters: -16x2 Serial LCD with 4 buttons (menu,enter,up,down)

As a microcontroller has no underlaid operating system like a PC, there are so many different possibilities for number of keys, type of key input, visual representation, and functions, that you'd need virtually thousands of different menu libraries to fit every need.

Besides of that, the type of project may require different approaches: In some cases it may be suitable, that the user just can switch the operating mode between: - menu mode (menu is active, nothing else working) - normal mode (normal operating mode, menu not active) This may be perfect in cases, where the microcontroller does only slow control actions like a timer switch, where the menu is just needed for rare input of new switching times over the day, so its a "configuration menu" or "setup menu".

In other cases it might be required, that the microcontroller controls other tasks at the same time, while the menu is active. Let's say a laser cutter is driving its laser cutting program while the user enters the menu, and can do changes to the configuration while the program is working at the same time.

One type of menu (switch between normal/menu) would be possibly be easier to implement as a library.

The other type of menu (normal control and menu active at the same time) would require a sophisticated integration into the programming logic of the actual project. I think that such a type of menu cannot be easily seperated as a library, easy to use and easy to integrate into a project at the same time, but on the other side that's most likely what most users want.

What I wanted to say: Handling buttons and displays for menu actions besides of "normal" programming logic is not really a thing to be handled by a novice programmer of microcontrollers.

Within the last few weeks there had been some questions about the "LCD Keypad Shield", which provides five buttons on one analog pin combined with a 16x2 LCD text display: - SELECT - UP - DOWN - LEFT - RIGHT

In two cases I provided some demo source for the thread opener: One is a "quiz controller" and the other a "text input" demo.

So meanwhile I have some experience with code for 5-button shields to work out some programming logic.

What I can offer: If you consider to add a 5th button, so that your buttons fit the logic of the LCD keypad shield buttons, perhaps also connected to one single analog input pin using a handful of resistors, I'd consider to help creating a menu system for that.