       delay(20);
     }
 }
+void settlerest(float resttime){//rest time in ms
+  lcd.clear();
+  lcd.setCursor(0,0);
+  lcd.print("settle EST ");
+  lcd.setBacklight(VIOLET);
+  unsigned long startrest = millis();
+  digitalWrite(air, LOW);
+  digitalWrite(fill, LOW);
+  digitalWrite(decant, LOW);
+  
+  x=0;
+  while (x==0){
+      if (millis()-startrest > resttime){
+       x=1;
+      }
+      else if (millis()-startrest < resttime){
+       int timedisplay = round((resttime-(millis()-startrest))/1000);
+       lcd.setCursor(0,1);
+       lcd.print(timedisplay);lcd.print("sec  ");
+      }
+      delay(20);
+    }
+}
 void decantdrain(){//rest time in ms
   lcd.clear();
   lcd.setCursor(0,0);

      }
      else if (millis()-startdecant < decanttime){
       digitalWrite(decant, HIGH);
       int timedisplay = round((decanttime-(millis()-startdecant))/60/1000);
       lcd.setCursor(0,1);
       lcd.print(timedisplay);lcd.print("min  ");
      }
      delay(20);
    }
  digitalWrite(air, LOW);
  digitalWrite(fill, LOW);
  digitalWrite(decant, LOW);
}



//int slowsludge = 5;

int x=0;
float TimeToFill=60000;//300000;//5min
float airtimer=60000;//600000;//10min
//float partialemptytime=30000;//60000;//1min
float decanttime=60000;//600000;//10min
unsigned long timenow;

void setup() {
