How to read the pulse width from GPIO

shatirah_
Posts: 1
Joined: Thu Jan 11, 2024 2:55 am

How to read the pulse width from GPIO

Postby shatirah_ » Thu Jan 11, 2024 5:11 am

Hi, I'm new to Espressif-IDE software and currently working with ESP32-S3.
I try to capture the pulse width time by using the example code provided: https://github.com/espressif/esp-idf/bl ... _hc_sr04.c

The signal from the product be sent continuously to 1 GPIO pin.
So from the code, I disable the Trig function and use the Echo function only to read the pulse. I'm not sure if the code is suitable for my case or not, but for the first time, its able to read the exact reading as the oscilloscope. But now the code reading become unstable.

Please advice me the right way to write code to read the pulse width.
Thank you in advance.

Who is online

Users browsing this forum: No registered users and 107 guests