*Solved*Stepper library not working properly?

Hi, I have a stepper connected to the Arduino. I’m trying to control it using the stepper library, but it just vibrates instead of spinning. It is wired corectly, as it works fine if I use this code:

int motorPin1 = 0;
int motorPin2 = 1;
int motorPin3 = 2;
int motorPin4 = 3;
int delayTime = 50;

void setup() {
  pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);
  pinMode(motorPin3, OUTPUT);
  pinMode(motorPin4, OUTPUT);
}

void loop() {
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, HIGH);
  digitalWrite(motorPin4, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, HIGH);
  delay(delayTime);
}

I looked into the Stepper library code, and it seems like it should do the same thing, but it doesn’t?

EDIT: Found the issue. The stepper library actually turns on 2 coils at a time for some reason. I changed it to only turn on 1 at a time and it works perfectly :slight_smile:

Regards,
Dan