Hello everyone!
I have tried for weeks to get my stepper motor to work properly. I have a 28byj-48 5V DC as my stepper motor and a ULN2003 as my Driver which is quite commonly used.
I have watched many tutorials and how to's using these specific motor and driver and tried their code ( Over 20 different codes that works for them with the same motor and driver) , ive also tried coding it myself but nothing seems to work.
Ive only got one code work somewhat but as soon i change anything it does not work.
If i change the stepper.setspeed from something other than 60 it does not work even if i change the rev accordingly.
The code that atleast did something is linked below.
It basically just keeps on spinning even if i add a delay in the loop it stops working.
What could be the problem? a faulty driver or a faulty motor maybe?
#include <Stepper.h>
const int Steps = 512;
boolean dir = false;// false =clockwise, true=counter clockwise
Stepper stepper(Steps, D1, D3, D2, D4);
void setup()
{
stepper.setSpeed(60);
Serial.begin(9600);
}
void loop()
{
stepper.step(Steps);
}