NEW USER-help on stepper motor control programming

Hi All

I am working with my final year project and am a new user with the testing the stepper motor with L293D motor shield.

I have written the codes with “Arduino 1.0.5” and was stuck with the motor looping itself after 1 revolution (200 steps) and after delay (10000)

My intention was to only rotate forward 1 revolution and STOP.

Kindly advise any alteration to the codes

THX
COCO2014

#include <AFMotor.h>

// Connect a stepper motor with 48 steps per revolution (7.5 degree)
// to motor port #1 (M1 and M2)
AF_Stepper motor(48, 1);

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps

motor.setSpeed(20); // 20 rpm
}

void loop() {
motor.step(200, FORWARD, DOUBLE);
delay (10000);
}

If you literally only want it to make a single revolution and then stop the simplest thing is to move the 2 lines of code from loop() and put it into setup(). Actually there is then no need for the line with delay().

Leave loop() with nothing between the curly brackets.

...R