diff options
| author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-20 06:46:52 -0400 | 
|---|---|---|
| committer | Marti Bolivar <mbolivar@mit.edu> | 2010-10-20 06:46:52 -0400 | 
| commit | 85c1c72db022bba891868afd3375e39dbe245701 (patch) | |
| tree | 9d86a3db825667362a8c89a98a205586015aec94 /source/arduino/delaymicroseconds.rst | |
| parent | abcfcc62cc62dfc088d30d5a6b6c36d6c89f7b07 (diff) | |
| download | librambutan-85c1c72db022bba891868afd3375e39dbe245701.tar.gz librambutan-85c1c72db022bba891868afd3375e39dbe245701.zip | |
initial check-in of arduino docs in RST format (converted using wget+pandoc)
Diffstat (limited to 'source/arduino/delaymicroseconds.rst')
| -rw-r--r-- | source/arduino/delaymicroseconds.rst | 93 | 
1 files changed, 93 insertions, 0 deletions
| diff --git a/source/arduino/delaymicroseconds.rst b/source/arduino/delaymicroseconds.rst new file mode 100644 index 0000000..0feaba7 --- /dev/null +++ b/source/arduino/delaymicroseconds.rst @@ -0,0 +1,93 @@ +.. _arduino-delaymicroseconds: + +delayMicroseconds() +=================== + +Description +----------- + +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. + + + +Syntax +------ + +delayMicroseconds(us) + + + +Parameters +---------- + +us: the number of microseconds to pause (*unsigned int*) + + + +Returns +------- + +None + + + +Example +------- + +:: + +      +    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. + + + +Caveats and Known Issues +------------------------ + +This function works very accurately in the range 3 microseconds and +up. We cannot assure that delayMicroseconds will perform precisely +for smaller delay-times. + + + +As of Arduino 0018, delayMicroseconds() no longer disables +interrupts. + + + +See also +-------- + + +-  `millis <http://arduino.cc/en/Reference/Millis>`_\ () +-  `micros <http://arduino.cc/en/Reference/Micros>`_\ () +-  `delay <http://arduino.cc/en/Reference/Delay>`_\ () + + | 
