Need some help !

Hi,

I'm working on a school project which requires me to turn a stepper motor to a certain degree every 12 hours or so. I'm using the Arduino Uno circuit board (I got from the arduino starter kit) and Arduino Uno Motor Shield R3 to turn my PM4222-09 stepper motor. I can't seem to get the codes right. I've been working on it for the past 4 days (on the codes only). But the outcome doesn't match my specifications. My stepper motor rotates a little bit before it delays for 3 seconds and repeat.(The "delay(300)" will be changed to a larger number to meet my specification when the codes are all correct).
Do help me out with this. I'm really new to this Arduino thing.

here is my code:

#include <Stepper.h>

Stepper myStepper = Stepper(100, 8, 9, 12, 13);

int delaylength = 80;

void setup() {

pinMode(12, OUTPUT);
pinMode(13, OUTPUT);

pinMode(9, OUTPUT);
pinMode(8, OUTPUT);

}

void loop(){

{

digitalWrite(9, LOW);
digitalWrite(8, HIGH);

digitalWrite(12, HIGH);
analogWrite(3, 250);

delay(delaylength);

digitalWrite(9, HIGH);
digitalWrite(8, LOW);

digitalWrite(13, LOW);
analogWrite(11, 250);

delay(delaylength);

digitalWrite(9, LOW);
digitalWrite(8, HIGH);

digitalWrite(12, LOW);
analogWrite(3, 250);

delay(delaylength);

digitalWrite(9, HIGH);
digitalWrite(8, LOW);

digitalWrite(13, HIGH);
analogWrite(11, 250);

delay(delaylength);

}
delay(300);

}

You need help reading the READ ME BEFORE POSTING thread.

Then you need help finding the forum section on MOTORS and 90% likelihood of seeing the answers you seek and more just browsing threads. And if you don't then you'd probably learn enough to ask better questions.

hah.

That about sums it up.

Have you considered using the AccelStepper library?

...R

Robin2:
Have you considered using the AccelStepper library?

...R

Or even the regular Stepper library?

You might want to give some thought to explaining what the code you incorrectly posted actually does, and how that differs from what you want, too.