You are reading a single comment by @fobus and its replies. Click here to read the full conversation.
  • But I would want to understand why the code below doesn't work?It is expected to do same think but not.

    var step = 0;
    var steps = [0b0001,0b0011,0b0010,0b0110,0b0100,0b11­00,0b1000,0b1001];
    var stepperPins = [D1,D2,D3,D4]; // Change these to pins for your motor driver
    
    function doStep() {
     step++;
     digitalWrite(stepperPins, steps[step % steps.length]);
    }
    var stepInterval = setInterval(doStep, 1);
    
About

Avatar for fobus @fobus started