My problem with the programmation

Hi my friend,
I want to automatize my terrarium and I have a problem with the code. I hope that you can help me :stuck_out_tongue:
I post my code:

//Il circuito è costituito da un Arduino 2009 collegato ad:
//1 - display LCD 16x2 modello Hitachi 
//2 - sensore di umidità e temperatura HDT11
//3 - 4 pulsanti con le funzioni di <UP>, <DOWN>, <NEXT>, <OK>
//4 - 2 relè che comanderano rispettivamento un riscaldatore e un umidificatore

#include <LiquidCrystal.h>
#include <Menu.h>
#include <MenuItem.h>
#include <SubMenu.h>
#include <SubMenuItem.h>
#include <dht.h>

// Inizializza display con i PIN ai quali è collegato
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//Definizione PIN
#define NEXT 10 
#define OK   9
#define UP   8
#define DOWN 7

//Variabili globali
int temp = 0;
int hum = 0;
int maxtemp = 0;
int mintemp = 0;
int maxhum = 0;
int minhum = 0;

//Inizializza men√Ļ
//Il men√Ļ sar√† costituito da 4 pagine:
//1 - Home -> nella quale saranno mostrate umidità e temperatura misurate
//2 - Temperatura -> nella quale imposto la minima e la massima
//3 - Umidità -> nella quale imposto la minima e la massima

Menu menu = Menu(menuUsed,menuChanged); 

//Inizializza parti del men√Ļ
  MenuItem Home = MenuItem();
  MenuItem Temperature = MenuItem();
    SubMenu subMenuTemp = SubMenu(menuChanged);
      SubMenuItem Maxt = SubMenuItem();
      SubMenuItem Mint = SubMenuItem(); 
  MenuItem Humidity = MenuItem();
    SubMenu subMenuHum = SubMenu(menuChanged);
      SubMenuItem Maxh = SubMenuItem();
      SubMenuItem Minh = SubMenuItem();

void setup() {
  Serial.begin(9600);
  
//Configura pin I/O
  pinMode(NEXT, INPUT);  //Imposto il pulsante come input
  pinMode(OK, INPUT);    //Imposto il pulsante come input
  pinMode(UP, INPUT);    //Imposto il pulsante come input
  pinMode(DOWN, INPUT);  //Imposto il pulsante come input
  
//Setta il numero di righe e colonne LCD
  lcd.begin(16,2);
  lcd.clear();
 
  lcd.setCursor(0,0);
  lcd.print("LOADING...");
  delay(1000);
  lcd.clear();
  lcd.setCursor(0,1);
  lcd.print("Terrario");
  delay(1000);
  
//Configura men√Ļ
  menu.addMenuItem(Home);
  menu.addMenuItem(Temperature);
    Temperature.addSubMenu(subMenuTemp);
      subMenuTemp.addSubMenuItem(Maxt);
      subMenuTemp.addSubMenuItem(Mint);
  menu.addMenuItem(Humidity);
    Humidity.addSubMenu(subMenuHum);
      subMenuHum.addSubMenuItem(Maxh);
      subMenuHum.addSubMenuItem(Minh);
  
  menu.select(0);
  subMenuTemp.select(0);
  subMenuHum.select(0);
}

void loop(){
    
//Gestione dei casi 
    switch (Serial.read()){  
      case 'a':
        if (NEXT == HIGH) {
          menu.up();
        }
        break;
      case 'b':
        if (DOWN == HIGH){
          subMenuTemp.down(); //set index closer to maximum
        }
        break;
      case '0':
        menu.select(0);
        break;
    }
  }

void menuChanged(ItemChangeEvent event){
  Serial.println("menuChanged"); 
  if( event == &Home ){
    Serial.println("\tHome selected"); //user feedback
    lcd.setCursor(0,0);
    lcd.print("Temp: ");
    lcd.print(temp);
    lcd.print(" C");
    lcd.setCursor(0,1);
    lcd.print("Umid: ");
    lcd.print(hum);
    lcd.print(" %");
  }else if( event == &Temperature ){
    Serial.println("\tTemperature selected"); //user feedback
  }else if( event == &Maxt ){
    Serial.println("\tMax selected"); //user feedback
    lcd.setCursor(0,0);
    lcd.print("Max: ");
    lcd.print(maxtemp);
    lcd.print(" C");
  }else if( event == &Mint ){
    Serial.println("\tMin selected"); //user feedback
    lcd.setCursor(0,1);
    lcd.print("Min: ");
    lcd.print(mintemp);
    lcd.print(" C");
  }else if( event == &Humidity ){
    Serial.println("\tHumidity selected"); //user feedback
  }else if( event == &Maxh ){
    Serial.println("\tMax selected"); //user feedback
    lcd.setCursor(0,0);
    lcd.print("Max: ");
    lcd.print(maxhum);
    lcd.print(" %");
  }else if( event == &Minh ){
    Serial.println("\tMin selected"); //user feedback
    lcd.setCursor(0,1);
    lcd.print("Min: ");
    lcd.print(minhum);
    lcd.print(" %");
  }
}

void menuUsed(ItemUseEvent event){
  Serial.println("menuUsed"); 
  if( event == &Home ){
    Serial.println("\tHome used"); //user feedback
  }else if( event == &Maxt ){
    Serial.println("\tMax used"); //user feedback
  }else if( event == &Mint ){
    Serial.println("\tMin used"); //user feedback
  }else if( event == &Maxh ){
    Serial.println("\tMax used"); //user feedback
  }else if( event == &Minh ){
    Serial.println("\tMin used"); //user feedback
  }
}

The library to create a menu is not explain very well. The function "void menuUsed(ItemUseEvent event)" what is it?
Can you check my code, please?

Thank you.