control the motor rotation and listen on the ‘stepper motor driver’ interface pins hooked up to the motion controller upstream. The Arduino source for this can be found on the project GitHub.
There are a lot of fun projects you can do with stepper motors salvaged from ... he connects an LED across two random pins and spins the motor. If the LED lights, you’ve found a coil.