You are reading a single comment by @user52526 and its replies. Click here to read the full conversation.
  • @Gordon @DrAzzy

    This is the code I'm using to generate what is called a 'Wave Drive' using this module DC 5V Stepper Motor + ULN2003 Driver Test Module and this is the result I'm getting: video

    Can someone tell me why this motor is spinning so slowly?

    function stepper(func) {
      var a = C11, b = C9, c = C7, d = C6;
      var list = [d,c,b,a];
      for (var j = 0; j < 1000; j++) {
        for (var v = 0; v < list.length; v++) {
          digitalWrite(list[v],1);
          for (var h = 0; h < list.length; h++) {
            func(h,v,list);
          }
        }
        digitalWrite(d,0);
      }
      digitalWrite(a,0);
    }
    
    function stepperWaveDrive() {
      stepper(function (h,v,list) {
        if (list[h] != list[v]) digitalWrite(list[h],0);
      });
    }
    
    stepperWaveDrive();
    
    //stepperNormalFull();
    

    This is the attempt with Espruino 4 Step Control Code

    Video

    var step = 0;
    var steps = [0b0001,0b0010,0b0100,0b1000];
    var stepperPins = [C11,C9,C7,C6];
    
    function doStep() {
     step++;
     digitalWrite(stepperPins, steps[step % steps.length]);
    }
    var stepInterval = setInterval(doStep, 200);
    
About

Avatar for user52526 @user52526 started