(Solved) accelstepper code for stepper with constant speed in 2 directions

Attached is the only AccelStepper Library I am aware of. I don't know why you couldn't find the example I posted. It is the only example in the library. Do you know where the Library is (the folder?) Did you look in that folder ? Did you try "File\Examples\Accelstepper\one_stepper_example" ?

In the sample code:
Button one starts the stepper motor CW
Next press on the same button stops the motor.

Button two starts the stepper motor CCW
Next press on the same button stops the motor.

How can I get the motor to run CW or CCW?

I haven't received my stepper motor driver yet so I can't test it but I think you need to have code that executes a command statement based on which button is pressed. With a dc motor driver it would be a simple matter of reversing the direction bits but with a stepper you need some way to control the number of steps used in the command. I haven't done any stepper motor coding yet so all I can do to help you is to recommend that you google "arduino AccelStepper direction control"

AccelStepper-master.zip (59.6 KB)