I have probably tried 12 different tutorials trying to get this motor to work without any success. I have hooked up exactly like below and have tried all my motors and boards.
The only time it has worked is when I didn't use any libraries and defined an array for motor next steps, but I can't get it to go anymore and I want to use the library.
Does anyone have any ideas of what can cause problems with these supposed easy beginner projects? Generally.
you can see a tutorial I've followed here
28BYJ-48 4-Phase Stepper Motor
`//Includes the Arduino Stepper Library
#include <Stepper.h>
// Defines the number of steps per rotation
const int stepsPerRevolution = 2038;
// Creates an instance of stepper class
// Pins entered in sequence IN1-IN3-IN2-IN4 for proper step sequence
Stepper myStepper = Stepper(stepsPerRevolution, 8, 10, 9, 11);
void setup() {
// Nothing to do (Stepper Library sets pins as outputs)
}
void loop() {
// Rotate CW slowly at 5 RPM
myStepper.setSpeed(5);
myStepper.step(stepsPerRevolution);
delay(1000);
// Rotate CCW quickly at 10 RPM
myStepper.setSpeed(10);
myStepper.step(-stepsPerRevolution);
delay(1000);
}`