 
      
     val = analogRead(HPpin);
+    posMax=55;
+    posMin=50;
+    MouthTimer=20;
+    if (val>200) {
+    posMin=50;
+    posMax=60;
+    }
+    if (val>500) {
+    posMin=60;
+    posMax=75;
+    MouthTimer=40;
+    }
+    if (val>700) {
+    posMin=90;
+    posMax=110;
+    MouthTimer=80;
+    }
+   
 //Serial.println(val);
 //Serial.print('\n');
     if (val > MIN ) // if values detected : speaker voltage


Servo myservo;                 

int     MIN = 100; 
int     SecondDetection = 1; // 
int     val = 0;     // variable to store the read value
int     i = 0;
int     pos = 75;    // variable to store the servo position 
int     BoucheStatus = 0;
int     ActionBouche = 0;
int     Repos = 0;

        myservo.attach(servoPin);
        delay(1);
        }
      Serial.println(val);
      ActionBouche = 1;
      //myservo.attach(9);
      //delay(10);
      
     
      myservo.write(posMax);
      
      CompteurRepos=0;
      delay(MouthTimer);
      
      }
      if (BoucheStatus == 1 && ActionBouche == 1)
