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,0b1100,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.
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.
First thanks all, at the end I could drive it normally. Here is my code
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.