Coding the stepper motor, steps can be done with a switch statement and some I/O bits, but there's an easier way: use the built-in stepper library!
Primary LanguageC++
#include <Stepper.h>
or
#include <AccelStepper.h>