You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in my opinion the script should open only one pin at each step, otherwise the motor will not know in which direction should go.
But i repeat again, i'm not an expert and it could be my motor that needs to work in the way described by me, so i could be wrong. Anyway after adjusting your script and opening only one PIN at step it work correctly.
I'm using a kuman 28BYJ-48 stepper motor with the driver ULN2003, i got them from amazone.
The text was updated successfully, but these errors were encountered:
Hi,
first i need to thank you a lot for this great job!
second i'm not an expert of raspberryPi or stepper motor so i could be wrong.
In my opinion you could have some problems in your code that makes stepper motors work wrongly and even heat a bit because of this.
Let's see the case of 4 pinCount,
at each step you open 2 pins at the same time instead of one.
else if (thisModule.pinCount == 4) {
switch (thisStep % 4) {
case 0: // 1010
wpi.digitalWrite(thisModule.motorPin1, wpi.HIGH);
wpi.digitalWrite(thisModule.motorPin2, wpi.HIGH);
wpi.digitalWrite(thisModule.motorPin3, wpi.LOW);
wpi.digitalWrite(thisModule.motorPin4, wpi.LOW);
break;
case 1: // 0110
wpi.digitalWrite(thisModule.motorPin1, wpi.LOW);
wpi.digitalWrite(thisModule.motorPin2, wpi.HIGH);
wpi.digitalWrite(thisModule.motorPin3, wpi.HIGH);
wpi.digitalWrite(thisModule.motorPin4, wpi.LOW);
break;
.........
in my opinion the script should open only one pin at each step, otherwise the motor will not know in which direction should go.
But i repeat again, i'm not an expert and it could be my motor that needs to work in the way described by me, so i could be wrong. Anyway after adjusting your script and opening only one PIN at step it work correctly.
I'm using a kuman 28BYJ-48 stepper motor with the driver ULN2003, i got them from amazone.
The text was updated successfully, but these errors were encountered: