I’m working on a small stepper motor driven vehicle powered by a Raspberry Pi 3B. For the motor control, I am using the hardPWM function of the pigpio library from Joan, which is working great. I can set two different frequencies, one for each channel. It’s coded in C.

Now, I would like to keep track of the number of taken steps for measurement and more control.

Is there a build-in way to count impulses of each frequency or catching the rising edge via interrupt?

Or even input a number of impulses for a certain frequency?

Or is there even a better way for all that?

I would be grateful for any help.

Thanks in advance

New contributor
Nyge is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Nyge is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.