Help with implementing a Menu

I am trying to implement a menu for a temperature controller project and i am having a bit of difficulty understanding the structure of the menubackend library. The menu structure i want to have is the following:

Settings
|
|------------------------------------------------------------------------
| | | |
Brightness Calibration Alarms Dew Enable
| |
| |
Sensor 1-----Sensor 2 High Alarm-----Low Alarm
| |
| Temperature
|
|
Temperature----Humidity

Is the following code correct when it comes to creating the menu options?

#include <MenuBackend.h>

MenuItem Brightness = MenuItem("Brighness");
MenuItem Calibration = MenuItem("Calibration)";
MenuItem Sesnor_1 = MenuItem("Sensor 1");
MenuItem Temperature = MenuItem ("Temperature");
MenuItem Humidity = MenuItem("Humidity");
MenuItem Sensor_2 = MenuItem("Sensor 2");
MenuItem Temperature_2 = MenuItem("Temperature");
MenuItem Alarms = MenuItem("Alarms");
MenuItem High_Alarm = MenuItem("High Alarm");
MenuItem Low_Alarm = MenuItem ("Low Alarm");
MenuItem Dew_enable = MenuItem("Dew Enable");

menu.getRoot().add(Brightness);
Brightness.addRight(Calibration).addRight(Alarms).addRight(Dew_enable);
Calibration.add(Sesnor_1).addRight(Sensor_2);
Sesnor_1.add(Temperature).addRight(Humidity);
Sensor_2.add(Temperature_2);
Alarms.add(High_Alarm).addRight(Low_Alarm);

void setup(){}
void loop(){}

I would stick to the default parent child structure since it is easier to read and just change the display name. This is what I have for one I am working on.

//Menu variables
MenuBackend menu = MenuBackend(menuUsed,menuChanged);
//initialize menuitems
MenuItem menu1Item1 = MenuItem("Edit Settings");
MenuItem menuItem1SubItem1 = MenuItem("On Temp.");
MenuItem menuItem1SubItem2 = MenuItem("Off Temp.");
MenuItem menuItem1SubItem3 = MenuItem("Battery Offset");
MenuItem menu1Item2 = MenuItem("Status");
MenuItem menuItem2SubItem1 = MenuItem("Fans");
MenuItem menuItem2SubItem2 = MenuItem("Sensors");
MenuItem menuItem2SubItem3 = MenuItem("Bat. Voltage");
MenuItem menu1Item3 = MenuItem("Log Info");
MenuItem menuItem3SubItem1 = MenuItem("Min/Max - In");
MenuItem menuItem3SubItem2 = MenuItem("Min/Max - Out");

You also need to edit the menu values farther down the page...

if(newMenuItem.getName()==menu.getRoot()){
mySerial.print("Main Menu ");
// ------ Edit Setings Menu: ------
}else if(newMenuItem.getName()=="Edit Settings"){
mySerial.print("Edit Settings ");
}else if(newMenuItem.getName()=="On Temp."){
mySerial.print("On Temp. edit ");
}else if(newMenuItem.getName()=="Off Temp."){
mySerial.print("Off Temp. edit ");
}else if(newMenuItem.getName()=="Battery Offset"){
mySerial.print("Bat.Offsetet edt");
// ------ Status Menu: ------
}else if(newMenuItem.getName()=="Status"){
mySerial.print("Status Display ");
}else if(newMenuItem.getName()=="Fans"){
mySerial.print("Fans status ");
}else if(newMenuItem.getName()=="Sensors"){
mySerial.print("Temp Sens. Disp.");
}else if(newMenuItem.getName()=="Bat. Voltage"){
mySerial.print("Bat. Voltage ");
// ------ Log Info Menu: ------
}else if(newMenuItem.getName()=="Log Info"){
mySerial.print("Saved Data ");
}else if(newMenuItem.getName()=="Min/Max - In"){
mySerial.print("Inside temps ");
}else if(newMenuItem.getName()=="Min/Max - Out"){
mySerial.print("Outside temps ");
}

Hope that helps...

Also find,

long debounceDelay = 500;    // the debounce time

and change it to

long debounceDelay = 150;    // the debounce time

I found 500 to be way to long...

after some head scratching i manged to implement the menu i described above but i've hit a snag and i can't find my way around it so some assistance is much appreciated and i can't find any links with. Since my project takes control of all the digital inputs i can use the analog inputs for the buttons in order to access the menu. The setup for the buttons i use is http://tronixstuff.com/2011/01/11/tutorial-using-analog-input-for-multiple-buttons/ i altered the code from the tutorial Tutorial: manage menu and LCD display with Arduino – Coagula – Giuseppe Di Cillo but i can't access the menu. Can you tell me what am i doing wrong?

#include <MenuBackend.h> //MenuBackend library - copyright by Alexander Brevig
#include <LiquidCrystal.h> //this library is included in the Arduino IDE

const int buttonLeft= 4; // Left button
const int buttonRight= 3; // Right button
const int buttonEsc= 2; // Esc button
const int buttonEnter= 1; // Enter button

int ButtonPushed = 0;

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

//Menu variables
MenuBackend menu = MenuBackend(menuUsed,menuChanged);
//initialize menuitems
MenuItem brightness = MenuItem("Brightness");
MenuItem calibration = MenuItem("Calibration");
MenuItem Sensor_1 = MenuItem("Sensor 1");
MenuItem Temperature = MenuItem("Temperature");
MenuItem Humidity = MenuItem("Humidity");
MenuItem Sensor_2 = MenuItem("Sensor 2 Temp");
MenuItem Dew_enable = MenuItem("Dew Enable");
MenuItem Alarms = MenuItem("Alarms");
MenuItem L_Alarm = MenuItem("Low Alarm");
MenuItem H_Alarm = MenuItem("High Alarm");

void setup()
{

pinMode(A0, INPUT_PULLUP);
lcd.begin(20, 4);

//configure menu
menu.getRoot().add(brightness);
brightness.addRight(calibration).addRight(Dew_enable).addRight(Alarms);
calibration.add(Sensor_1).addRight(Sensor_2);
Sensor_1.add(Temperature).addRight(Humidity);
Alarms.add(L_Alarm).addRight(H_Alarm);
menu.toRoot();
lcd.setCursor(0,0);

} // setup()...

void loop()
{

readButtons(); //I splitted button reading and navigation in two procedures because
navigateMenus(); //in some situations I want to use the button for other purpose (eg. to change some settings)

} //loop()...

void menuChanged(MenuChangeEvent changed){

MenuItem newMenuItem=changed.to; //get the destination menu

lcd.setCursor(0,1); //set the start position for lcd printing to the second row

if(newMenuItem.getName()==menu.getRoot()){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Settings");
}else if(newMenuItem.getName()=="Brightness"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Brightness");
}else if(newMenuItem.getName()=="Calibration"){
lcd.print("Calibration");
}else if(newMenuItem.getName()=="Sensor 1"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Sensor 1 ");
}else if(newMenuItem.getName()=="Temperature"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Temperature ");
}else if(newMenuItem.getName()=="Humidity"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Humidity");
}else if(newMenuItem.getName()=="Sensor 2 Temp"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Sensor 2 Temp");
}else if(newMenuItem.getName()=="Dew Enable"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Dew Enable");
}else if(newMenuItem.getName()=="Alarms"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Alarms ");
}else if(newMenuItem.getName()=="Low Alarm"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Low Alarm");
}else if(newMenuItem.getName()=="High Alarm"){
lcd.clear();
lcd.setCursor(0,1);
lcd.print("High Alarm");
}
}

void menuUsed(MenuUseEvent used){
lcd.setCursor(0,0);
lcd.print("You used");
lcd.setCursor(0,1);
lcd.print(used.item.getName());
delay(3000); //delay to allow message reading
lcd.setCursor(0,0);
menu.toRoot(); //back to Main
}

void readButtons(){ //read buttons status

int reading;
int ButtonEnterState=LOW; // the current reading from the Enter input pin
int ButtonEscState=LOW; // the current reading from the input pin
int ButtonLeftState=LOW; // the current reading from the input pin
int ButtonRightState=LOW; // the current reading from the input pin

//Enter button
// read the state of the switch into a local variable:
reading = analogRead(0);

// check to see if you just pressed the enter button
// (i.e. the input is at 10 and 18):
if (reading > 10 && reading < 18) {
ButtonEnterState = HIGH;
ButtonEscState=LOW;
ButtonLeftState=LOW;
ButtonRightState=LOW; }

//Esc button
// check to see if you just pressed the Down button
// (i.e. the input is 65 and 75):
else if (reading > 65 && reading < 75) {
ButtonEscState = HIGH;
ButtonEnterState=LOW;
ButtonLeftState=LOW;
ButtonRightState=LOW;}

//Right button
// check to see if you just pressed the Down button
// (i.e. the input is 115 and 128)
else if (reading > 115 && reading < 128) {
ButtonRightState = HIGH;
ButtonEnterState=LOW;
ButtonEscState=LOW;
ButtonLeftState=LOW;}

//Left button
// check to see if you just pressed the Down button
// (i.e. the input is 160and 175
else if (reading > 160 && reading < 175) {
ButtonLeftState = HIGH;
ButtonEnterState=LOW;
ButtonEscState=LOW;
ButtonRightState=LOW;}

//records which button has been pressed
if (ButtonEnterState==HIGH){
ButtonPushed=buttonEnter;

}else if(ButtonEscState==HIGH){
ButtonPushed=buttonEsc;

}else if(ButtonRightState==HIGH){
ButtonPushed=buttonRight;

}else if(ButtonLeftState==HIGH){
ButtonPushed=buttonLeft;

}else{
ButtonPushed=0;
}
}

void navigateMenus() {
MenuItem currentMenu=menu.getCurrent();

switch (ButtonPushed){
case buttonEnter:
if(!(currentMenu.moveDown())){ //if the current menu has a child and has been pressed enter then menu navigate to item below
menu.use();
}else{ //otherwise, if menu has no child and has been pressed enter the current menu is used
menu.moveDown();
}
break;
case buttonEsc:
menu.toRoot(); //back to main
break;
case buttonRight: //move right
menu.moveRight();
break;
case buttonLeft: //move left
menu.moveLeft();
break;
}

ButtonPushed=0; //reset the lastButtonPushed variable
}

[/quote]

You are using the same pins for the LCD as the buttons?

const int buttonLeft=   4;      // Left button
const int buttonRight=  3;     // Right button
const int buttonEsc=    2;       // Esc button
const int buttonEnter=  1;    // Enter button

int ButtonPushed = 0;

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

Or are you using one analog pin for all four buttons?