I've been using these little (28byj-48) stepper motors for years, with great joy and succes.
But this week something happend that I can't explain and can't find here.
The problem is that when the Arduino starts the motor "randomly" chooses a direction to turn in,
most of the times (66%) it gets it right but then suddenly it turns the reverse direction on start.
Also now the motor turns in the reverse direction when the load gets too big, where it used to just stall or miss steps.
This is the code I usually start with (and is working in a lot of projects):
#include <Stepper.h>
const int stepsPerRevolution = 2048;
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
void setup() {
myStepper.setSpeed(12);
}
void loop() {
myStepper.step(stepsPerRevolution);
delay(1000);
myStepper.step(-stepsPerRevolution);
delay(1000);
}
I've been buying these motors for years and have tested both old and new versions of the motors and boards. With the same result.
I'm using the same 7.5V 0.35A power supply with a common ground to the Arduino.
Am I missing something or has the stepper.h lib changed?
Hope someone can point me in the right direction (no pun intended).
Cheers