DelayMicroseconds()

From Microduino Wiki
Revision as of 02:37, 17 August 2016 by Fengfeng (talk) (Created page with "<pre style="color:green"> void delayMicroseconds (unsigned int us) </pre> Delay (microsecond) <br> Delay, in microseconds (1ms is equal to 1000micros). If the delay time i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
void delayMicroseconds (unsigned int us)   

Delay (microsecond)

Delay, in microseconds (1ms is equal to 1000micros). If the delay time is thousands of microseconds, delay function is recommended, of which the maximum parameter supported is 16383micos (it maybe changed in the later versions).

  • Example

The following code send pulse to the no.8 pin, and every time the pulse lasts 50micos.


int outPin = 8;                 // digital pin 8

void setup()
{
  pinMode(outPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  digitalWrite(outPin, HIGH);   // sets the pin on
  delayMicroseconds(50);        // pauses for 50 microseconds      
  digitalWrite(outPin, LOW);    // sets the pin off
  delayMicroseconds(50);        // pauses for 50 microseconds      
}

[Return to Arduino Syntax Manual]