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


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.write(posMin);
       Repos = 0;
       CompteurRepos = 0;
       ActionBouche =0;
       delay(20);
       //digitalWrite(servoPin, LOW);
      }

