arduino sketch: uses timer2 overflow interrupts to evenly sequence half-step signaling to drive a stepper motor with a dual H-bridge. It displays speed, direction, and on/off status to an LCD, and needs two buttons (on/off, left/right) set up with pullups to +5V to operate. Stepper is attached to lower 4 bits of PortB, lcd to portD, and the buttons to upper bits of PortB.

x-arduino - 3.25 kB - 01/21/2020 at 05:07