   delayMicroseconds(10);
   digitalWrite(ultraTrig, LOW);
   lecture_echo = pulseIn(ultraEcho, HIGH);
-  cm = lecture_echo/29;
+  cm = lecture_echo / 29;
 
   return cm;
 }
 
-void ultraCheck(int ultraBuffer[10]) {
-  long cm = 0;
-  for (int i = 0; i < 10; i++) {
-    cm += ultraBuffer[i] / 10;
-  }
-
-  Serial.println(cm);
+void ultraCheck(void) {
+  int i = ultraCompteur % 10;
+  int first_i = (ultraCompteur + 1) % 10;
+  ultraBuffer[i] = ultraMesure();
+  ultraSum += ultraBuffer[i];
+  ultraSum -= ultraBuffer[first_i];
+  Serial.println(ultraSum / 10);
+
+  if (ultraSum / 10 < 20) {
+    digitalWrite(13, HIGH);
+  } else {
+    digitalWrite(13, LOW);
+  }
+  ultraCompteur++;
 }
 
 void stopRight() {

  pinMode(rightMotorPin1, OUTPUT);
  pinMode(rightMotorPin2, OUTPUT);

  // Ultrason
  pinMode(ultraTrig, OUTPUT);
  digitalWrite(ultraTrig, LOW);
  pinMode(ultraEcho, INPUT);
  ultraCompteur = 1;
  ultraSum = 0;
  
  //DebugLed
  pinMode(13,OUTPUT);

  // Serial
  Serial.begin(9600);

  initializeTimer1();
}

void loop() {
  // TODO Script to win here ;)
  int i = ultraCompteur % 10;
  int first_i = (ultraCompteur + 1) % 10;
  ultraBuffer[i] = ultraMesure();
  ultraSum += ultraBuffer[i];
  ultraSum -= ultraBuffer[first_i];

if (ultraSum/10 < 20){
  digitalWrite(13,HIGH);
  } else {
    digitalWrite(13,LOW);
    }
  ultraCompteur++;


}

// Serial

{
  switch (serialInput[0])
  {
    case 'r':
    case 'R': // Rotation
      if (serialInput[1] == 'L' || serialInput[1] == 'l') {
