This is the code I created to operate a single-phase excitation stepper motor. Without an argument it moves one step clockwise, and if you pass true as an argument it moves one step counterclockwise.
When you press the button, the LED matrix displays a dice roll animation and stops on a random number between 1 and 6. Built using SPI communication with the MAX7219 driver.