user11556: I have some existing code that I've been using with an Uno and a HC-SR04. In order to make my project less expensive, I'm trying to port everything over to a ESP8266-01.
The last hang up I've been running into is that it appears that the ESP8266 doesn't support the pulseIn function.
duration = pulseIn(echoPin, HIGH);

Any idea on how I can change the pulseIn function with interrupts or something else?
Lastly I've done a lot of searching for using a HC-SR04 with a ESP8266 and while there are a couple examples out there, I haven't seen anyone do it with Arduino code...

user4143: pulseIn() is actually a very simple function.  As long as there is a microseconds counter of some form available you can easily enough roll your own.
Also, I don't know which implementation of the ESP8266 plugin you are using, but the one I use has pulseIn available.

11556: <p>I have some existing code that I've been using with an Uno and a HC-SR04. In order to make my project less expensive, I'm trying to port everything over to a ESP8266-01.</p>

<p>The last hang up I've been running into is that it appears that the ESP8266 doesn't support the pulseIn function.</p>

<pre><code>duration = pulseIn(echoPin, HIGH);
</code></pre>

<p>Any idea on how I can change the pulseIn function with interrupts or something else?</p>

<p>Lastly I've done a lot of searching for using a HC-SR04 with a ESP8266 and while there are a couple examples out there, I haven't seen anyone do it with Arduino code...</p>
 4143: <p><code>pulseIn()</code> is actually a very simple function.  As long as there is a microseconds counter of some form available you can easily enough roll your own.</p>

<p>Also, I don't know which implementation of the ESP8266 plugin you are using, but <a href="https://github.com/esp8266/Arduino" rel="nofollow">the one I use</a> has <a href="https://github.com/esp8266/Arduino/blob/esp8266/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_pulse.c" rel="nofollow">pulseIn available</a>.</p>
