This is the code used for the automatic candy dispenser shown in this YoutTube video: https://youtu.be/KxcxH3_G3Es
Please come back later for the wiring schematics.
This wires together a stepper motor (driven by a TB6600 stepper driver), an Arduino Uno board, and an IR Break sensor