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

Some question about delayMicroseconds()

$
0
0

I tested the arduino function  delayMicroseconds() in the following program on Edison arduino board. I want produce a square wave of T=400us and duty=50%.

But I got a square wave of T=600us and duty=50%. I watched the wave on an oscilloscope.

Why? And how can i get a accurate delay of us?

 

void setup() {

  // put your setup code here, to run once:

  pinMode(12,OUTPUT);

}

 

 

void loop() {

  // put your main code here, to run repeatedly:

 

  digitalWrite(12,LOW);

  delayMicroseconds(200);

  digitalWrite(12,HIGH);

  delayMicroseconds(200);

 

}


Viewing all articles
Browse latest Browse all 18357

Trending Articles



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