I’ve found the Accelstepper library http://www.open.com.au/mikem/arduino/AccelStepper/ great, just use
AccelStepper(1, stepPinNumber, dirPinNumber) myStepper
to have it give step & direction outputs as required by the A4988.
Check the examples given, its way easier than I expected.
