Hide minor edits - Show changes to markup
delayMicroseconds(us)
To ensure more accurate delays, this functions disables interrupts during its operation, meaning that some things (like receiving serial data, or incrementing the value returned by millis()) will not happen during the delay. Thus, you should only use this function for short delays, and use delay() for longer ones.
delayMicroseconds(0) will generate a much longer delay than expected (~1020 us) as will using negative numbers as a parameter.
As of Arduino 0018, delayMicroseconds() no longer disables interrupts.
us: the number of microseconds to pause.
us: the number of microseconds to pause (unsigned int)
Pauses the program for the amount of time (in microseconds) specified as parameter. For delays longer than a few thousand microseconds, you should use delay() instead.
Currently, the largest value that will produce an accurate delay is 16383. This could change in future Arduino releases.
Pauses the program for the amount of time (in microseconds) specified as parameter. There are a thousand microseconds in a millisecond, and a million microseconds in a second.
Currently, the largest value that will produce an accurate delay is 16383. This could change in future Arduino releases. For delays longer than a few thousand microseconds, you should use delay() instead.
us: the number of microseconds to pause. (There are a thousand microseconds in a millisecond, and a million microseconds in a second.)
us: the number of microseconds to pause.
delayMicroseconds(0) will generate a much longer delay than expected (~1020 us) as will negative numbers.
delayMicroseconds(0) will generate a much longer delay than expected (~1020 us) as will using negative numbers as a parameter.
Pauses your program for the amount of time (in microseconds) specified as parameter. For delays longer than a few thousand microseconds, you should use delay() instead.
Pauses the program for the amount of time (in microseconds) specified as parameter. For delays longer than a few thousand microseconds, you should use delay() instead.
Users should use care when using a variable as the parameter for delayMicroseconds. delayMicroseconds(0) will generate a much longer delay than expected (~1020 us) as will negative numbers, if passed as a parameters to delayMicroseconds.
Users desiring to patch delayMicroseconds(0) to work correctly (return immediately) should see this forum thread.
delayMicroseconds(0) will generate a much longer delay than expected (~1020 us) as will negative numbers.
Users should use care when using a variable as the parameter of delayMicroseconds. delayMicroseconds(0) will generate a much longer delay than expected ~1020 us as will negative numbers, if passed as a parameters to delayMicroseconds.
Users should use care when using a variable as the parameter for delayMicroseconds. delayMicroseconds(0) will generate a much longer delay than expected (~1020 us) as will negative numbers, if passed as a parameters to delayMicroseconds.
Users desiring to patch delayMicroseconds(0) to work correctly (return immediately) should see this forum thread.
Users desiring to patch delayMicroseconds(0) to work correctly (return immediately) should see this forum thread.
Users should use care when using a variable as the parameter of delayMicroseconds. delayMicroseconds(0) will generate a much longer delay than expected ~1020 us as will negative numbers, if passed as a parameters to delayMicroseconds.
Users desiring to patch delayMicroseconds(0) to work correctly (return immediately) should see this forum thread.
Currently, the largest value that will produce an accurate delay is 16383. This could change in future Arduino releases.
Pauses your program for the amount of time (in microseconds) specified as parameter.
Pauses your program for the amount of time (in microseconds) specified as parameter. For delays longer than a few thousand microseconds, you should use delay() instead.
us: the number of microseconds to pause. (There are a thousand microseconds in a millisecond, and a million microseconds in a second.) The largest value that will result in an accurate delay is 16383.
us: the number of microseconds to pause. (There are a thousand microseconds in a millisecond, and a million microseconds in a second.)
us: the number of microseconds to pause. (there are a thousand microseconds in a millisecond, and a million microseconds in a second)
us: the number of microseconds to pause. (There are a thousand microseconds in a millisecond, and a million microseconds in a second.) The largest value that will result in an accurate delay is 16383.
This function works very accurately in the range 10 microseconds and up. We cannot assure that delayMicroseconds will perform precisely for smaller delay-times.
This function works very accurately in the range 3 microseconds and up. We cannot assure that delayMicroseconds will perform precisely for smaller delay-times.
To ensure more accurate delays, this functions disables interrupts during its operation, meaning that some things (like receiving serial data, or incrementing the value returned by millis()) will not happen during the delay. Thus, you should only use this function for short delays, and use delay() for longer ones.
It pauses your program for the amount of time (in microseconds) specified as parameter.
It takes one integer value as parameter. This value represents microseconds.
nothing
Pauses your program for the amount of time (in microseconds) specified as parameter.
us: the number of microseconds to pause. (there are a thousand microseconds in a millisecond, and a million microseconds in a second)
None
It pauses your program for the amount of time (in microseconds) specified as parameter.
It takes one integer value as parameter. This value represents microseconds.
nothing
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
}
configures pin number 8 to work as an output pin. It sends a train of pulses with 100 microseconds period.
This function works very accurately in the range 10 microseconds and up. We cannot assure that delayMicroseconds will perform precisely for smaller delay-times.