Quantcast
Channel: Intel Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 41305

delayMicroseconds large overhead?

$
0
0

I am new to Galileo and Arduino - trying out the following code,


void loop()

{

  Serial.print(micros());

  Serial.print("\n");

  for(int i = 0; i < 10000; i ++){

      delayMicroseconds(10);

  }

  Serial.print(micros());

  Serial.print("\n");

}

It takes about 1.8 seconds to go through -  each delayMicroseconds takes about 180 microseconds to complete instead of 10 microseconds? How can I get better resolution here? Thanks!


Viewing all articles
Browse latest Browse all 41305

Trending Articles



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