How to measure pulse width on an HC-SR04
Posted: Sun May 13, 2018 7:31 pm
Hi
I would like to use an HC-SR04 to measure distances. The way that device works is to return a pulse whose length is proportional to the distance being measured (ultrasonic reflection). I saw that there is a way to do this on Arduino (pulseIn - see http://www.instructables.com/id/Distanc ... a-NodeMCU/), but I am not using Arduino software, rather the native ESP IDF. How can I code this in C?. Please bear with me as I am new to this chip and its environment.
Many thanks
David
I would like to use an HC-SR04 to measure distances. The way that device works is to return a pulse whose length is proportional to the distance being measured (ultrasonic reflection). I saw that there is a way to do this on Arduino (pulseIn - see http://www.instructables.com/id/Distanc ... a-NodeMCU/), but I am not using Arduino software, rather the native ESP IDF. How can I code this in C?. Please bear with me as I am new to this chip and its environment.
Many thanks
David