and RyanTM responded with a link to decrDude's very useful guide.
However, decrDude has posted much more than that. He's posted a complete Arduino solution WITH the Eagle files and working "sketch".
He even will sell you a shield to do it, saving you the trouble and time.
Look at https://forum.pololu.com/t/a4988-dev-board/3822/1 and be impressed! I sure was.