     }
     task2 = millis();
   }
+
+  // show menu
+  if ((unsigned long)(currmillis - task4) >= 500){
+    val = digitalRead(inPin);
+    //Serial.print(F("value = "));
+    //Serial.println(val);
+    task4 = millis();
+    if(val >= 1){  
+      dspmenu(switchstate);
+      task5 = millis();
+    }
+    val = 0;
+  }
+
+  // switch automatic menu
+  if ((unsigned long)(currmillis - task6) >= 5000){
+    if(displayON == true){
+      dspmenu(switchstate);
+    }
+    task6 = millis();
+  }
+
+  // switch after 10 Seconds display off
+  if ((unsigned long)(currmillis - task5) == 120000){
+    Serial.println(F("switch off after time"));
+    if(displayON == true){
+      displaypower(false);
+    }
+  }
+}
+
+/*
+// convert integer to 2 digits
+void print2digits(int number) {
+  if (number >= 0 && number < 10) {
+    tpf.write('0');
+  }
+  tpf.print(number);
+}
+
+//get date from time
+String stringdate(){
+  time_t t;
+  String d = String(day(t));
+  d += ".";
+  d += String(month(t));
+  d += ".";
+  d += String(year(t));
+  return d;
+}
+
+//get time from time
+String stringhour(){
+  time_t t;
+  String h = String(hour(t));
+  h += ":";
+  h += String(minute(t));
+  h += ":";
+  return h;
+}
+*/
+// display menu
+void dspmenu(int m){
+  switch (m){
+    case 0:
+      contbuild = "Humidity\n";
+      contbuild += float_to_str(float(45.5));
+      //contbuild += float_to_str(float(get_hum()));
+      contbuild += "%";
+      
+      printOLED(content=contbuild, X=0, Y=16, textsize=2);
+      clearOLED();
+      switchstate = 1;
+      break;
+    case 1:
+
+      contbuild = "Temperatur\n";
+      //contbuild += float_to_str(float(get_temp()));
+      contbuild += float_to_str(float(24.7));
+      contbuild += " ";
+      contbuild += (char(247));
+      contbuild += "C";
+      printOLED(content=contbuild, X=0, Y=16, textsize=2);
+      clearOLED();
+      switchstate = 2;
+      break;
+    case 2:
+
+      contbuild = "IP Adresse\n";
+      if(CURRIP == ""){
+        contbuild += "NO IP";
+      } else {
+        contbuild += CURRIP;
+      }
+      
+      printOLED(content=contbuild, X=0, Y=16, textsize=1); //print content
+      clearOLED();
+      switchstate = 3;
+      break;
+    case 3:
+      contbuild = TOKEN;
+      printOLED(content="WEB TOKEN", X=0, Y=0, textsize=2); //print header line
+      printOLED(content=contbuild, X=0, Y=16, textsize=2); //print content
+      clearOLED();
+      switchstate = 0;
+      break;
+  }
 }
 
 // Read temperature as Celsius (the default)

  }
}


      while(Serial1.available()){
        String tmpResponse = Serial1.readString();
        Serial.println(tmpResponse);
        //time_t t=tmpResponse.toFloat();
      }
      Serial1.println(F("AT+CIPCLOSE"));
    }
