Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 20046

Re: pulseIn

$
0
0

Hi Blackcode,

 

Can you try setting the pinMode for the echoPin to INPUT_FAST inside setup() instead of the inside  loop().

 

also delayMicroseconds() does not work reliably for timings less than 200 uS.
You can replace this with a while loop.

 

int wait = 2;

unsigned long t1;

unsigned long t2;

 

t1 = micros();

t2 = t1;

while((t2-t1) < wait)

{

     t2 = micros();

}


Viewing all articles
Browse latest Browse all 20046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>