help with code

Hi All, I hope some of you can help. I'm using a Uno and 28BYJ-48 Unipolar Stepper with ULN2003 driver board. I got it working just fine and can change some of the code to change the speed and rotation direction, so far so good. However what I'm trying to do is to have the motor do several turns without stopping or going backwards I want to control the speed and duration of the rotation and them do the same in reverse. I hope you can help.

Here is the code that I'm using and is working.

<#include

//Define Constants

//Number of steps per interval motor revolution const float STEPS_PER_REV = 32;

// Amount of gear reduction const float GEAR_RED = 64;

//Number of steps per geared output rotation const float STEPS_PER_OUT_REV = STEPS_PER_REV * GEAR_RED;

//Define veriables

//Number of steps required int StepsRequired;

// Create Instance of Stepper Class // Specify Pins Used are 8,9,10,11 // Connected to ULN2003 motor driver In1, In2, In3, In4 // Pins connected in sequence1-2-3-4 for proper set sequencing

Stepper steppermotor(STEPS_PER_REV, 8, 10, 9, 11);

void setup() { //Nothing (stepper library sets pins as outputs) }

void loop() { //slow - 4 step CW sequence to observe lights on server board steppermotor.setSpeed(1); StepsRequired = 4; steppermotor.step(StepsRequired); delay(2000);

//Rotate CW1/2 turn slowly StepsRequired = STEPS_PER_OUT_REV / 1; steppermotor.setSpeed(100); steppermotor.step(StepsRequired); delay(1000);

//Rotate CCW 1/2 turn quickly StepsRequired = - STEPS_PER_OUT_REV / 1; steppermotor.setSpeed(100); steppermotor.step(StepsRequired); delay(1000); }

Thanks,

I want to control the speed and duration of the rotation and them do the same in reverse.

Will these controls be hard coded into the program or do you need a user to be able to change them, maybe even when the program is running ?

Please look at Read this before posting a programming question for advice on how to post a programming question properly