PulseIn function
Posted: Sun Apr 30, 2017 2:33 am
Hi, I'm trying to use HC-SR04 ultrasound sensor with ESP8266 Basic. I've found viewtopic.php?f=153&t=11794, but this "analog" approach decrease accuracy on longer distances, which is inacceptable for my application (measuring water level in rainwater reservoir - I need it accurate especially, when water level is low = far away from sensor).
Something like https://www.arduino.cc/en/Reference/pulseIn function would make this goal very easy, since the whole measurement can be done by a few lines of code like https://community.thinger.io/t/esp8266- ... c-sr04/386. (HC-SR04 triggers measurement by at least 10 us long pulse, so using 1ms should not be problem, no "full" driver for HC-SR04 needed.)
I think, PulseIn function may by handy for another applications as well.
BTW: ESP8266 Basic is a great concept - I like the fact, I may change my program "on site" without connecting anything to my computer!
Something like https://www.arduino.cc/en/Reference/pulseIn function would make this goal very easy, since the whole measurement can be done by a few lines of code like https://community.thinger.io/t/esp8266- ... c-sr04/386. (HC-SR04 triggers measurement by at least 10 us long pulse, so using 1ms should not be problem, no "full" driver for HC-SR04 needed.)
I think, PulseIn function may by handy for another applications as well.
BTW: ESP8266 Basic is a great concept - I like the fact, I may change my program "on site" without connecting anything to my computer!