Code Read by Arduino Board But Stepper Motor Won't Run

Hi all, my stepper stopped working all of a sudden. About a week ago, I was able to upload my Arduino code below and control the stepper motor. Today when I ran the code it throws me this message:

"Sketch uses 798 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes."

It seems like the Arduino Board is picking up the code. But for some reason isn't relaying it to the stepper motor.

const int dirPin = 2;
const int stepPin = 3;
const int stepsPerRevolution = 200;

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  digitalWrite(dirPin, LOW);

  //Spin motor slowly
  for(int x = 0; x < stepsPerRevolution; x++){
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(2000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(2000);
  }
}

void loop() {
}

This is a normal message after a compile.

Are you sure you did an upload and not just a compile (verify)? Does it say "Done uploading" in the bar above the output windows of the IDE?

// Added
How do you power your stepper?
Which stepper do you use?
Which driver (if any)?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.