Все, спасибо всем. наконецто я добился чего хотел выкладываю скеч, может кому пригодиться
PHP код:
#include <Stepper.h>

#define STEPS 360 

Stepper stepper(STEPS2345);
int pol 5
int x ;
void setup() 

  
stepper.setSpeed(30);
//  Serial.begin(9600);
stepper.step(-1000); // место этого возможно будет концевик, что бы не делать лишнии шаги
 


void loop() 

  
digitalWrite(20);
  
digitalWrite(30);
  
digitalWrite(40);
  
digitalWrite(50);
 
// int sensorValue = analogRead(5);
 // Serial.println(sensorValue, DEC);
  //******************
  //******************
  // ПОЛОЖЕНИЕ 1
  //******************
  //******************
  
if ((261 <= analogRead(pol) ) && ( analogRead(pol) <=265) && (!= 1) ) 
  { 
    if (
== 9)  
    { 
      
stepper.step(-1000); 
      
x=1;  
    }
    if (
== 8)  
    { 
      
stepper.step(-875); 
      
x=1;  
    }
    if (
== 7)  
    { 
      
stepper.step(-750); 
      
x=1;  
    }
    if (
== 6)  
    { 
      
stepper.step(-625); 
      
x=1;  
    }
    if (
== 5)  
    { 
      
stepper.step(-500); 
      
x=1;  
    }
    if (
== 4)  
    { 
      
stepper.step(-375); 
      
x=1;  
    }
    if (
== 3)  
    { 
      
stepper.step(-250); 
      
x=1;  
    }
    if (
== 2)  
    { 
      
stepper.step(-125); 
      
x=1;  
    }
  }
  
//******************
  //******************
  // ПОЛОЖЕНИЕ 2
  //******************
  //******************

  
if ((284 <= analogRead(pol) ) && ( analogRead(pol) <=288) && (!= 2) ) 
  { 
       if (
== 0)  
    { 
      
stepper.step(125); 
      
x=2;  
    }

    if (
== 1)  
    { 
      
stepper.step(125); 
      
x=2;  
    }
    if (
== 9)  
    { 
      
stepper.step(-875); 
      
x=2;  
    }
    if (
== 8)  
    { 
      
stepper.step(-750); 
      
x=2;  
    }
    if (
== 7)  
    { 
      
stepper.step(-625); 
      
x=2;  
    }
    if (
== 6)  
    { 
      
stepper.step(-500); 
      
x=2;  
    }
    if (
== 5)  
    { 
      
stepper.step(-375); 
      
x=2;  
    }
    if (
== 4)  
    { 
      
stepper.step(-250); 
      
x=2;  
    }
    if (
== 3)  
    { 
      
stepper.step(-125); 
      
x=2;  
    }

  }
//******************
  //******************
  // ПОЛОЖЕНИЕ 3
  //******************
  //******************


  
if ((313 <= analogRead(pol) ) && ( analogRead(pol) <=316) && (!= 3) ) 
  { 
       if (
== 0)  
    { 
      
stepper.step250  ); 
      
x=3  ;  
    }

      if (
== 1)  
    { 
      
stepper.step(250); 
      
x=3;  
    }
    if (
== 2)  
    { 
      
stepper.step(125); 
      
x=3;  
    }
    if (
== 9)  
    { 
      
stepper.step(-750); 
      
x=3;  
    }
    if (
== 8)  
    { 
      
stepper.step(-625); 
      
x=3;  
    }
    if (
== 7)  
    { 
      
stepper.step(-500); 
      
x=3;  
    }
    if (
== 6)  
    { 
      
stepper.step(-375); 
      
x=3;  
    }
    if (
== 5)  
    { 
      
stepper.step(-250); 
      
x=3;  
    }
    if (
== 4)  
    { 
      
stepper.step(-125); 
      
x=3;  
    }


  }
//******************
  //******************
  // ПОЛОЖЕНИЕ 4
  //******************
  //******************

  
if ((348 <= analogRead(pol) ) && ( analogRead(pol) <=351) && (!= 4) ) 
  { 
    
      if (
== 0)  
    { 
      
stepper.step(  375 ); 
      
x;  
    }


       if (
== 1)  
    { 
      
stepper.step(375); 
      
x=4;  
    }
    if (
== 2)  
    { 
      
stepper.step(250); 
      
x=4;  
    }
    if (
== 3)  
    { 
      
stepper.step(125); 
      
x=4;  
    }
    if (
== 9)  
    { 
      
stepper.step(-625); 
      
x=4;  
    }
    if (
== 8)  
    { 
      
stepper.step(-500); 
      
x=4;  
    }
    if (
== 7)  
    { 
      
stepper.step(-375); 
      
x=4;  
    }
    if (
== 6)  
    { 
      
stepper.step(-250); 
      
x=4;  
    }
    if (
== 5)  
    { 
      
stepper.step(-125); 
      
x=4;  
    }



  }
//******************
  //******************
  // ПОЛОЖЕНИЕ 5
  //******************
  //******************

  
if ((389 <= analogRead(pol) ) && ( analogRead(pol) <=395) && (!= 5) ) 
  { 
      if (
== 0)  
    { 
      
stepper.step500  ); 
      
x=5  ;  
    }

   if (
== 1)  
    { 
      
stepper.step(500); 
      
x=5;  
    }
    if (
== 2)  
    { 
      
stepper.step(375); 
      
x=5;  
    }
    if (
== 3)  
    { 
      
stepper.step(250); 
      
x=5;  
    }
    if (
== 4)  
    { 
      
stepper.step(125); 
      
x=5;  
    }
    if (
== 9)  
    { 
      
stepper.step(-500); 
      
x=5;  
    }
    if (
== 8)  
    { 
      
stepper.step(-375); 
      
x=5;  
    }
    if (
== 7)  
    { 
      
stepper.step(-250); 
      
x=5;  
    }
    if (
== 6)  
    { 
      
stepper.step(-125); 
      
x=5;  
    }


  }
//******************
  //******************
  // ПОЛОЖЕНИЕ 6
  //******************
  //******************

  
if ((445 <= analogRead(pol) ) && ( analogRead(pol) <=451) && (!= 6) ) 
  { 
    
      if (
== 0)  
    { 
      
stepper.step625  ); 
      
x=  6;  
    }


     if (
== 1)  
    { 
      
stepper.step(625); 
      
x=6;  
    }
    if (
== 2)  
    { 
      
stepper.step(500); 
      
x=6;  
    }
    if (
== 3)  
    { 
      
stepper.step(375); 
      
x=6;  
    }
    if (
== 4)  
    { 
      
stepper.step(250); 
      
x=6;  
    }
    if (
== 5)  
    { 
      
stepper.step(125); 
      
x=6;  
    }
    if (
== 9)  
    { 
      
stepper.step(-375); 
      
x=6;  
    }
    if (
== 8)  
    { 
      
stepper.step(-250); 
      
x=6;  
    }
    if (
== 7)  
    { 
      
stepper.step(-125); 
      
x=6;  
    }

  }
//******************
  //******************
  // ПОЛОЖЕНИЕ 7
  //******************
  //******************

  
if ((518 <= analogRead(pol) ) && ( analogRead(pol) <=525) && (!= 7) ) 
  { 
      if (
== 0)  
    { 
      
stepper.step750  ); 
      
x;  
    }

    if (
== 1)  
    { 
      
stepper.step(750); 
      
x=7;  
    }
    if (
== 2)  
    { 
      
stepper.step(625); 
      
x=7;  
    }
    if (
== 3)  
    { 
      
stepper.step(500); 
      
x=7;  
    }
    if (
== 4)  
    { 
      
stepper.step(375); 
      
x=7;  
    }
    if (
== 5)  
    { 
      
stepper.step(250); 
      
x=7;  
    }
    if (
== 6)  
    { 
      
stepper.step(125); 
      
x=7;  
    }
    if (
== 9)  
    { 
      
stepper.step(-250); 
      
x=7;  
    }
    if (
== 8)  
    { 
      
stepper.step(-125); 
      
x=7;  
    } 


  }
//******************
  //******************
  // ПОЛОЖЕНИЕ 8
  //******************
  //******************

  
if ((620 <= analogRead(pol) ) && ( analogRead(pol) <=630) && (!= 8) ) 
  {  
      if (
== 0)  
    { 
      
stepper.step875  ); 
      
x;  
    }

    if (
== 1)  
    { 
      
stepper.step(875); 
      
x=8;  
    }
    if (
== 2)  
    { 
      
stepper.step(750); 
      
x=8;  
    }
    if (
== 3)  
    { 
      
stepper.step(625); 
      
x=8;  
    }
    if (
== 4)  
    { 
      
stepper.step(500); 
      
x=8;  
    }
    if (
== 5)  
    { 
      
stepper.step(375); 
      
x=8;  
    }
    if (
== 6)  
    { 
      
stepper.step(250); 
      
x=8;  
    }
    if (
== 7)  
    { 
      
stepper.step(125); 
      
x=8;  
    }
    if (
== 9)  
    { 
      
stepper.step(-125); 
      
x=8;  
    }
  }
//******************
  //******************
  // ПОЛОЖЕНИЕ 9
  //******************
  //******************

  
if ((770 <= analogRead(pol) ) && ( analogRead(pol) <=780) && (!= 9) ) 
  { 
    
     if (
== 0)  
    { 
      
stepper.step(1000); 
      
x=9;  }
       if (
== 1)  
    { 
      
stepper.step(1000); 
      
x=9;  
    }
    if (
== 2)  
    { 
      
stepper.step(875); 
      
x=9;  
    }
    if (
== 3)  
    { 
      
stepper.step(750); 
      
x=9;  
    }
    if (
== 4)  
    { 
      
stepper.step(625); 
      
x=9;  
    }
    if (
== 5)  
    { 
      
stepper.step(500); 
      
x=9;  
    }
    if (
== 6)  
    { 
      
stepper.step(375); 
      
x=9;  
    }
    if (
== 7)  
    { 
      
stepper.step(250); 
      
x=9;  
    }
    if (
== 8)  
    { 
      
stepper.step(125); 
      
x=9;  
    }

  }