 
 //PINOUT
 
-#define PIN_ENABLE_A     33      // Activation off all stepper
-#define PIN_ENABLE_B     27      // Activation off all stepper
-
-#define PIN_STEP_A       31      // PIN STEP FOR X
-#define PIN_DIR_A        29      // PIN DIRECTION FOR X 
-
-#define PIN_STEP_B       25      // PIN STEP FOR X
-#define PIN_DIR_B        23      // PIN DIRECTION FOR X 
-
-#define PIN_STEP_X       26      // PIN STEP FOR X
-#define PIN_DIRECTION_X  24      // PIN DIRECTION FOR X 
-
-#define PIN_STEP_Y       4       // PIN STEP FOR Y
-#define PIN_DIRECTION_Y  3       // PIN DIRECTION FOR Y
-
-#define PIN_STEP_Z       8       // PIN STEP FOR Y
-#define PIN_DIRECTION_Z  9       // PIN DIRECTION FOR Y
-#define Z_POSITION       35      // PIN FOR THE DIGITAL INPUT FOR THE HEAD POSITION
-
-#define TRIGGER_LIGHT    36      // PIN TRIGGER FOR START/STOP THE LIGHTING INSIDE THE BALL
-#define LIGHTING         37      // PIN FOR FEED THE LIGHTING
-
-#define SWITCH_1         34      // TRIGGER NOT USED FOR THE MOMENT
-
-#define LED_1            48      // LED 1
-#define LED_2            44      // LED 2
-#define LED_3            40      // LED 3
-#define LED_4            46      // LED 4
-#define LED_5            42      // LED 5
+//#define PIN_ENABLE_A     33      // Activation off all stepper
+//#define PIN_ENABLE_B     27      // Activation off all stepper
+
+#define PIN_STEP_A       4      // PIN STEP FOR X
+#define PIN_DIR_A        5      // PIN DIRECTION FOR X 
+#define PIN_STEP_B       6      // PIN STEP FOR X
+#define PIN_DIR_B        7      // PIN DIRECTION FOR X 
+#define PIN_ENABLE_AB    9 
+
+#define PIN_ENABLE_X     43
+#define PIN_STEP_X       51      // PIN STEP FOR X        //26
+#define PIN_DIRECTION_X  53      // PIN DIRECTION FOR X   //24 
+#define PIN_X_MS_1       45
+#define PIN_X_MS_2       47
+#define PIN_X_MS_3       49
+
+#define PIN_ENABLE_Y     31     
+#define PIN_STEP_Y       39       // PIN STEP FOR Y       // 4
+#define PIN_DIRECTION_Y  41       // PIN DIRECTION FOR Y  // 3
+#define PIN_Y_MS_1       33
+#define PIN_Y_MS_2       35
+#define PIN_Y_MS_3       37
+
+#define PIN_ENABLE_Z     23
+#define PIN_STEP_Z       27      // PIN STEP FOR Y
+#define PIN_DIRECTION_Z  29       // PIN DIRECTION FOR Y
+#define PIN_Z_MS_1       25
+#define Z_POSITION       22
+
+#define BP_LEFT          52
+#define BP_RIGH          50
+
+#define LED_1            48
+#define LED_2            46
+#define LED_3            44
+#define LED_4            42
+#define LED_5            40
+#define LED_6            38
+
+#define TRIGGER_LIGHT    24      // PIN TRIGGER FOR START/STOP THE LIGHTING INSIDE THE BALL
+#define LIGHTING         26      // PIN FOR FEED THE LIGHTING
+
+#define POWER_1          28
+#define POWER_2          30
+#define AUX_1			 32
+#define AUX_2            34
+#define AUX_3            36
+
+#define BUZZER           3
 
 #define PING             13
-
-#define LIGHT            20      // Pin for turn on/off lighting on the ball (Great for a technical maintenance ;) )
-
-#define CURRENT          0
-#define VOLTAGE          6
+#define PIN_RESET        12
+
+
+//#define LIGHT            20      // Pin for turn on/off lighting on the ball (Great for a technical maintenance ;) )
+
+//#define CURRENT          0
+//#define VOLTAGE          6
 
 // I2C
 int  I2C_ADRESS         = 1;

int     MAX_Y          = 135;   // SET THE MAX INCLINAISON FOR Y

int     ETALON_X       = 0;     // AJUSTEMENT FOR X
int     ETALON_Y       = -6;    // AJUSTEMENT FOR Y
int     ETALON_B_X     = 0;     // AJUSTEMENT FOR X
int     ETALON_B_Y     = -6;    // AJUSTEMENT FOR Y


  'SET x87 y75 h3 \n'        // SET a new setpoint for x and y with 3degree of Hysteressis
  'SET x90 y90 i1 j0 k1 \n'  // SET an inversion of the sensor X Y and invert the direction of X

    x = SETPOINT for X
  y = SETPOINT for Y
  m = MULTIPLIER FOR THE SPEED OF THE MOTOR X and Y
  i = INVERT the angle sensor ( X = Y and Y = X )
  j = INVERT the direction of X
  k = INVERT the direction of Y
  h = SET a new HYSTERESSIS

  < BOOT >
  'BOOT \n'  // LAUNCH TEST for X, Y and Z -> Return X and Y to initial SETPOINT (x90 y90 ) and Z to ZERO

  < RUN >
  'RUN \n'   // RUN the code in production mode (Recieved all data, X and Y runing for the SETPOINT poistion and Z folow the remote controll

  < STOP >
  'STOP \n'  // STOP the production mode. All motors are stopped.

  < ROTATE >
  'ROTATE d1 s100 \n'   // ROTATE Z motor on the RIGHT DIRECTION (d0 LEFT, d1 RIGHT) WITH the SPEED at 1000/100 = 10 step/sec = 18dec/sec

  < STAT >
  'STAT \n' // It is all data SENDED to the remote

  < ENABLE >
  'ENABLE a1 x1 z1 \n'    // ENABLE MOTOR AB, XY and Z (a = AB, x=XY, z = Z | 0 = desabled | 1 = enabled )
