   
       
       if(btnNEXT.getState()==Button::STATE::DOWN){
-          
+        stateMode=STATEMODE::NORMAL;
         stato=STATE::IDLE;
         displayTimer1=0;
         displayTimer2=0;

      }
    break;
    
    case STATE::MESUREMENT:

    if(btnNEXT.getState()==Button::STATE::DOWN){
       if(stateMode==STATEMODE::MESURE){
             writeRCT0(totalRCT.average(counterRCTCycle));
          }
        stato=STATE::END;

            lcd.clear();
         }
      }else{
        if(stateMode==STATEMODE::MEASURE){
          lcd.setCursor(0,0);        lcd.print(F("Rct0 calcolato: "));       
          lcd.setCursor (0,1);        lcd.print(F("RCT0 medio: "));        lcd.print(readRCT0(),3);
          lcd.setCursor(0,2); lcd.print(F("Tamb: ")); lcd.print(buttonAmb.value);
          lcd.setCursor(0,3); lcd.print(F("Riaccendi la macchina")); 
         }else if (stateMode== STATEMODE::CLEAN){
          lcd.setCursor(0,0);        lcd.print(F("Rct senza taratura"));       
          lcd.setCursor (0,1);        lcd.print(F("RCT medio: "));       lcd.print(totalRCT.average(counterRCTCycle),3);
          lcd.setCursor(0,2); lcd.print(F("Tamb: ")); lcd.print(buttonAmb.value);
          lcd.setCursor(0,3); lcd.print(F("Riaccendi la macchina")); 
         } else{
        lcd.setCursor(0,0);        lcd.print(F("Ta: "));        lcd.print(buttonAmb.value,1);     lcd.print(F(" Tp:"));        lcd.print(buttonPlate.dValue,1);
        lcd.setCursor (0,1);        lcd.print(F("RCT medio:  "));        lcd.print(totalRCT.average(counterRCTCycle),3);
        lcd.setCursor(0,2);        lcd.print(F("Clo medio:"));        lcd.print(rct2Clo(totalRCT.average(counterRCTCycle)),3);
