var step = 0;
var steps = [0b0001,0b0010,0b0100,0b1000];
var stepperPins = [A3,A2,B10,B11]; // Change these to pins for your motor driver
function doStep() {
step++;
digitalWrite(stepperPins, steps[step % steps.length]);
}
var stepInterval = setInterval(doStep, 200);
But it works so slow, approximately 0.5RPM. When I set interval to 30ms it is a little bit faster, but approximately 1RPM. I have tried with 5V and 9V input.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello,
I'm using this code to run my step motor :
I'm using 28BYJ-48 – 5V stepper motor and controller : http://robocraft.ru/files/datasheet/28BYJ-48.pdf
But it works so slow, approximately 0.5RPM. When I set interval to 30ms it is a little bit faster, but approximately 1RPM. I have tried with 5V and 9V input.
What I am doing wrong?