I have looked for a menuing system where it would be easy to describe a menu to Arduino and found none that would suit me. So I decided to write one.
All that you need to do is to create a string with your menu items like this:
const String menuItems = "-READ:000" "--SENSORS:000" "---SENSOR A1:101" "---SENSOR A2:102" "--SWITCHES:000" "---SWITCH PIN 4:103" "---SWITCH PIN 5:104" "-SET:000" "--SERVO ARM:105" "--SERVO BASE:106" "-MOVE SERVOS:107"; Menu menu(menuItems);
On each line you have dashes that specify at what level the item is, i'ts label, and an integer that specifies what action is to be taken if this item is selected. Those integers can be used in a switch case construct.
The library can also take care of displaying the menu on a LCD and of reading the switches to navigate the menu.
You can find the library and a tutorial here.
p.s. Il y a aussi un tutoriel en francais.