Starting and stopping a loop via a button

These links may be of interest

Stepper Motor Basics
Simple Stepper Code

...R