aboutsummaryrefslogtreecommitdiffstats
path: root/source/lang/micros.rst
diff options
context:
space:
mode:
Diffstat (limited to 'source/lang/micros.rst')
-rw-r--r--source/lang/micros.rst65
1 files changed, 21 insertions, 44 deletions
diff --git a/source/lang/micros.rst b/source/lang/micros.rst
index 711c013..f12976b 100644
--- a/source/lang/micros.rst
+++ b/source/lang/micros.rst
@@ -1,69 +1,46 @@
+.. highlight:: cpp
+
.. _lang-micros:
micros()
========
-Description
------------
-
-Returns the number of microseconds since the Arduino board began
-running the current program. This number will overflow (go back to
-zero), after approximately 70 minutes. On 16 MHz Arduino boards
-(e.g. Duemilanove and Nano), this function has a resolution of four
-microseconds (i.e. the value returned is always a multiple of
-four). On 8 MHz Arduino boards (e.g. the LilyPad), this function
-has a resolution of eight microseconds.
-
-
-
-*Note*: there are 1,000 microseconds in a millisecond and 1,000,000
-microseconds in a second.
+Returns the number of microseconds since the Maple board began running
+the current program. This number will overflow (go back to zero),
+after approximately 70 minutes.
+.. note:: There are 1,000 microseconds in a millisecond, and 1,000,000
+ microseconds in a second.
+Library Documentation
+---------------------
-Parameters
-----------
-
-None
-
-
-
-Returns
--------
-
-Number of microseconds since the program started (*unsigned long*)
-
-
+.. doxygenfunction:: micros
Example
-------
::
- unsigned long time;
+ unsigned int time;
- void setup(){
- Serial.begin(9600);
+ void setup() {
}
- void loop(){
- Serial.print("Time: ");
+
+ void loop() {
+ SerialUSB.print("Time: ");
time = micros();
- //prints time since program started
- Serial.println(time);
+ // prints time since program started
+ SerialUSB.println(time);
// wait a second so as not to send massive amounts of data
delay(1000);
}
-
-
-See also
+See Also
--------
-
-- `millis <http://arduino.cc/en/Reference/Millis>`_\ ()
-- `delay <http://arduino.cc/en/Reference/Delay>`_\ ()
-- `delayMicroseconds <http://arduino.cc/en/Reference/DelayMicroseconds>`_\ ()
-
-
+- :ref:`millis() <lang-millis>`
+- :ref:`delay() <lang-delay>`
+- :ref:`delayMicroseconds() <lang-delaymicroseconds>`
.. include:: cc-attribution.txt