These links may be of interest Stepper Motor Basics Simple Stepper Code
also look up the AccelStepper library
...R