aboutsummaryrefslogtreecommitdiffstats
path: root/source/lang/api/toggleled.rst
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-05-25 01:53:29 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-05-26 02:42:07 -0400
commit376e1c98b4e1d34c216dba4b8c320b0c083a7a1c (patch)
treede53df0e9dcb37b5a7f988e7234fd002d9c59fad /source/lang/api/toggleled.rst
parent6432343170fc6f7d24e75220948c5d4c38394476 (diff)
downloadlibrambutan-376e1c98b4e1d34c216dba4b8c320b0c083a7a1c.tar.gz
librambutan-376e1c98b4e1d34c216dba4b8c320b0c083a7a1c.zip
Docs: Move toggleLED() and waitForButtonPress() examples.
These two examples from board-values.rst really belong in the documentation for the functions they reference.
Diffstat (limited to 'source/lang/api/toggleled.rst')
-rw-r--r--source/lang/api/toggleled.rst22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/lang/api/toggleled.rst b/source/lang/api/toggleled.rst
index 54a7d64..cad347f 100644
--- a/source/lang/api/toggleled.rst
+++ b/source/lang/api/toggleled.rst
@@ -1,15 +1,35 @@
+.. highlight:: cpp
+
.. _lang-toggleled:
toggleLED()
===========
-Switches the LED from off to on, or on to off.
+*Toggle* the built-in LED: switch it from off to on, or on to off.
Library Documentation
---------------------
.. doxygenfunction:: toggleLED
+Example
+-------
+
+.. _lang-toggleled-example:
+
+This example sets up the board's LED pin for output, then toggles the
+LED every 100 milliseconds::
+
+ void setup() {
+ pinMode(BOARD_LED_PIN, OUTPUT);
+ }
+
+ void loop() {
+ toggleLED();
+ delay(100);
+ }
+
+
See Also
--------