   timeLastPressedMiddleButton = currentMillis;
 
   Serial.println("Middle Button Pressed");
+  
+    switch(currentState)
+  {
+    case ALARM: stopAlarm();
+    break;
+    case NORMAL :
+    {
+      if(showLCD){
+        currentState = SETTING_ALARM;
+        settingAlarmProcess = A_HOUR;
+      } else {
+        showLCD = true;
+      }
+
+    }
+    break;
+    case SETTING_ALARM:
+    {
+      if(settingAlarmProcess == A_HOUR){
+         settingAlarmProcess = A_MINUTE;
+      } else if(settingAlarmProcess == A_MINUTE){
+         settingAlarmProcess = A_TYPE;
+      } else {
+        currentState = NORMAL;
+      }
+
+    }
+    break;
+    case SETTING_TIME:
+    {
+      if(settingTimeProcess == T_HOUR){
+         settingTimeProcess = T_MINUTE;
+      } else if(settingTimeProcess == T_MINUTE){
+         settingTimeProcess = T_SECOND;
+      } else if(settingTimeProcess == T_SECOND){
+         settingTimeProcess = T_DAY;      
+      } else if(settingTimeProcess == T_DAY){
+        settingTimeProcess = T_MONTH; 
+      } else if(settingTimeProcess == T_MONTH){
+         settingTimeProcess = T_YEAR;           
+      } else {
+        currentState = NORMAL;
+      }
+      
+    }
+    break;
+    default: break;
+    }
 
 
 }

  timeLastPressedLeftButton = currentMillis;

  Serial.println("Left Button Pressed");


}

int getVoltageADCReading(){
  return analogRead(VOLTAGE_MEASURE_PIN); 
}


void turnOffLCD(){
  if(!showLCD){
    uView.clear(PAGE);
    uView.display();
  }
}

void processLeftButtonPressed(){
  unsigned long currentMillis = millis();

