user4924: Hi I have this ultrasonic sensor:
http://www.micropik.com/PDF/HCSR04.pdf
I use this code to read distances:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long time = pulseIn(echoPin,HIGH);

My question is this: in the datasheet says that the sensor will send 8 pulses at 40khz. Every pulse will take 0.000025 seconds so 8 pulses would be 200 usec.
So why the delay is only 10 usec if it should be 200usec?

user3878: The 10us delay is just your trigger pulse HIGH phase. Refer to the timing diagram on bottom of page two in your datasheet.

4924: <p>Hi I have this ultrasonic sensor:</p>

<p><a href="http://www.micropik.com/PDF/HCSR04.pdf" rel="nofollow">http://www.micropik.com/PDF/HCSR04.pdf</a></p>

<p>I use this code to read distances:</p>



<pre><code>digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long time = pulseIn(echoPin,HIGH);
</code></pre>

<p>My question is this: in the datasheet says that the sensor will send 8 pulses at 40khz. Every pulse will take 0.000025 seconds so 8 pulses would be 200 usec.</p>

<p>So why the delay is only 10 usec if it should be 200usec?</p>
 3878: <p>The 10us delay is just your trigger pulse HIGH phase. Refer to the timing diagram on bottom of page two in your datasheet.</p>
