     	else LED_PING = true;
     	digitalWrite(PING, LED_PING);
     	
-    	
-  
-    	
-    	
-    	
+	// IF THE MPU6050 ARE ALWAYS CONNECTED, IF NOT, HE RECONNECT AUTOMATICLY
     	if(!accelgyro.testConnection());
     	{
-    		production = false;
-    		emgStop = true;
-    		accelgyro.initialize();
-    		if(accelgyro.testConnection())
-    		{
-    			production = true;
-    		}
+    	    production = false;
+    	    emgStop = true;
+    	    accelgyro.initialize();
+    	    if(accelgyro.testConnection())
+    	    {
+    		production = true;
+    	    }
     	}
-    	
-    	
-    	
+     	
     	/*
     	
     	// SEND STATUT

    	Serial.println(" ");
    	
    	*/
    }
}

    	    if(directX) directX = false;
    	    else directX = true;
  	}
  	digitalWrite(pinDirX, directX); // dirX
  
  	// Si ont doit demarer le moteur
  	if(x > (setpointX + hysteresis) || (x < setpointX - hysteresis )) 
  	{ 
    	    if(x > minX && x < maxX) runX = true; 
    	    else runX = false;
  	}
  	else runX = false;
 
  	// Calcul du PID X
  	if(x < 90) vx = (90 - x); 
  	if(x == 0) vx = 0;
  	if(x > 90) vx = (x - 90);
  
  	speedX = 1000 / (vx);
  	speedX = speedX * multiplier; // DEL
  	if(speedX < 15) speedX = 15;
  
	// Mise en route du moteur
  	unsigned long currentX = millis();
  		
    	if (currentX - previousMillisX >= speedX) 
    	{
      	    previousMillisX = currentX;

	    if(runX)
      	    {
                digitalWrite(pinStepX, 1);
        	delayMicroseconds( 500 );
        	digitalWrite(pinStepX, 0);
    	 	delayMicroseconds( 500 );
            }
  	}

    	//======================================================================
	// Y88b   d88P 
	//  Y88b d88P  
  	//   Y88o88P   
   	//    Y888P    
    	//     888     
    	//     888     
        //     888     
        //     888  
	//======================================================================
	
	// Direction
  	if(y < 90) directY = false;
  	else directY = true;
  	if(invertY) 
  	{
    	    if(directY) directY = false;
    	    else directY = true;
  	}
  	digitalWrite(pinDirY, directY);
  
	// Si ont doit demarer le moteur
  	if(y > (setpointY + hysteresis) || (y < setpointY - hysteresis )) 
  	{ 
    	    if(y > minY && y < maxY) runY = true; 
    	    else runY = false;
  	}
  	else runY = false;
  
  	// Calcul du PID Y
  	if(y < 90) vy = (90 - y); 
  	if(y == 0) vy = 0;
  	if(y > 90) vy = (y - 90);
  
  	speedY = 1000 / (vy);
  	speedY = speedY * multiplier; // DEL
  	if(speedY < 15) speedY = 15;
 
	// Mise en route du moteur
  	unsigned long currentY = millis(); // millis();

    	if (currentY - previousMillisY >= speedY) 
    	{
      	    previousMillisY = currentY;
      
            if(runY)
      	    {
        	digitalWrite(pinStepY, 1);
        	delayMicroseconds( 500 );
        	digitalWrite(pinStepY, 0);
        	delayMicroseconds( 500 );
            }
  	} 
  
    	//======================================================================
	// 8888888888P 
        //       d88P  
        //      d88P   
    	//     d88P    
