 int coilb2 = 9;
 int enable = 10;
 
-int draainaarbeneden = 40;
+int draainaarbeneden = 0;
+int draainaarboven =0;
 int positie = 0;
 
 int maximumRange = 200;                   // Maximum range needed

                case 7:
                  a1();
                  positie = 0;
                  draainaarbeneden--;
                  break;
              }
              
            }else{
              digitalWrite(enable, LOW);
            }
        previousMillis = currentMillis;
     
    }



   
}

void Distance() { // meet de afstand van de sensor
 
  long duration, distance;                  // Duration used to calculate distance
  digitalWrite(timeOutPin, HIGH);

  else if (reader == 2) { myservo.write(100); delay(500); reader = -1; }
  else if (reader == 3) { myservo.write(0); delay(1000); reader = -1; }
  else if (reader == 4) { myservo.write(180); delay(1000); reader = -1; }
  else if (reader == 6) { myservo.write(180); draainaarbeneden = 10; reader = -1; }
  else if (reader == 7) { myservo.write(180); draainaarboven =10; reader = -1; }
  else{
    
     if (currentMillis - previousMillis >= interval) {
        Distance();
            if(draainaarboven>0){
              digitalWrite(enable, HIGH);
        
              switch(positie){
