Counting PWM pulses

Hi there,

I am trying to control a stepper motor with the Potato so I need to send pulses to the stepper driver. I am working in a python environment so simply bit-banging with sleep-timers is not very accurate and the stepper runs very jerky.
Sending the pulses from one of the PWM pins works great and the stepper runs perfectly smooth, however, I don’t have a way of tracking how many pulses I’ve sent/how many steps the motor has taken.
Is there any way to count how many pulses have been sent on the PWM pin?

Thank you! :slight_smile:

You can split a wire to another GPIO set to input mode and count that way.