You are reading a single comment by @fobus and its replies. Click here to read the full conversation.
  • First thanks all, at the end I could drive it normally. Here is my code

    var step = 0;
    var steps = [0b0001,0b0011,0b0010,0b0110,0b0100,0b11­00,0b1000,0b1001];
    var stepperPins = [E13,E11,E9,E7]; // Change these to pins for your motor driver
    function doStep() {
     step++;
     digitalWrite(stepperPins, steps[step % steps.length]);
    }
    
    function stop(){
      digitalWrite(stepperPins[0],LOW);
      digitalWrite(stepperPins[1],LOW);
      digitalWrite(stepperPins[2],LOW);
      digitalWrite(stepperPins[3],LOW);
    }
    
    function go(f) {
      for (i=0;i<f;i++) {
        x=0;
        while (x<10) x++;//Delaying needed I don't know why.
        doStep();
      }
      stop();
    }
    

    Can you explain me please how much degrees does the motor moves for each doStep() call?
    I think it must move 5.625° for each doStep() but it is not, may be it is 32 time less than 5.625°.

    Also, I have tried both 5V and 9V , 9V has a great torque. 5V some times unable to start spinning, torque is not hight.

About

Avatar for fobus @fobus started