Counting raising edges per second
-
Hello Forum,
I have a device which outputs a sort of PWM signal, better a pulse per count. I'd like to count the rising edges pers second and the ater transmit that value via BTLE (for now: just print the value every second).
I've read that micropython on the ESP32 cannot do hardware interrupts - true?
Is there a proven way to count rising edges per sond on the WiPy?Thank you,
Christian. -
@cts WiPy supports a Pin interrupt, which can be triggered with the rising edge. Look in the documentation for "Pin". And is has a timer module, which could be used for setting the gate time. Look in the documentation at "Timer". However, the precision and speed is very limited. Without testing, I would assume that it works reliably only for frequencies below 1 kHz, with a uncertainty of the gate time of about 1 ms. I
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login