Hello,
So i am developing a driver for the HC-SR04 ultrasonic senosr with esp-idf, and i don't seem to get it working. Do you have any suggestions on what api should i use for reading the pulse ? (i tried doing my own way but dosen't semm to work)
Reading pulse from HC-SR04 sensor
Re: Need a little help!
Howdy,
Did you try googling using "esp32 HC-SR04"? It seems to turn up quite a wealth of hits. Maybe examine some of these and see which APIs these folks used?
Please don't take this badly, but maybe consider a more descriptive names for your posts ... for example "Timing API for use with HC-SR04".
Did you try googling using "esp32 HC-SR04"? It seems to turn up quite a wealth of hits. Maybe examine some of these and see which APIs these folks used?
Please don't take this badly, but maybe consider a more descriptive names for your posts ... for example "Timing API for use with HC-SR04".
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Reading pulse from HC-SR04 sensor
I've renamed the post with a more meaningful name.
The ESP32 RMT peripheral is ideal for reading the gaps between pulse lengths. You can check out the RMT TX/RX example in ESP-IDF:
https://github.com/espressif/esp-idf/tr ... _nec_tx_rx
(In your case you only need the RX.)
The RMT peripheral driver is documented here:
http://esp-idf.readthedocs.io/en/latest ... s/rmt.html
The ESP32 RMT peripheral is ideal for reading the gaps between pulse lengths. You can check out the RMT TX/RX example in ESP-IDF:
https://github.com/espressif/esp-idf/tr ... _nec_tx_rx
(In your case you only need the RX.)
The RMT peripheral driver is documented here:
http://esp-idf.readthedocs.io/en/latest ... s/rmt.html
Re: Reading pulse from HC-SR04 sensor
I was about to program same sensor too to measure water levels during day.
I think it is very simple - you must create pin interrupt triggered on high at the 'echo' pin on the sensor.
You start device by setting 'trigger' pin high - then delay 10us and set it to low, save ticks and after that measure end ticks at the interrupt
I think it is very simple - you must create pin interrupt triggered on high at the 'echo' pin on the sensor.
You start device by setting 'trigger' pin high - then delay 10us and set it to low, save ticks and after that measure end ticks at the interrupt
Who is online
Users browsing this forum: No registered users and 82 guests