aboutsummaryrefslogtreecommitdiffstats
path: root/source/lang/api
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-06-10 09:10:03 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-06-10 09:10:03 -0400
commit036c04bbe6c75f71a66fad90530ac1dec5e47b53 (patch)
tree38b1b0a8d57bb47389d3f79ef1b36a0a5789c165 /source/lang/api
parenta2f4a145b2349638cf68e03efa4553055bd50315 (diff)
downloadlibrambutan-036c04bbe6c75f71a66fad90530ac1dec5e47b53.tar.gz
librambutan-036c04bbe6c75f71a66fad90530ac1dec5e47b53.zip
Docs: Use "BOARD_LED_PIN" instead of "13".
Fix examples where pin 13 was used explicitly instead of BOARD_LED_PIN. Also change an AVR-specific example in docs/lang/cpp/booleanvariables.rst to Maple conventions.
Diffstat (limited to 'source/lang/api')
-rw-r--r--source/lang/api/delay.rst13
-rw-r--r--source/lang/api/digitalwrite.rst7
2 files changed, 10 insertions, 10 deletions
diff --git a/source/lang/api/delay.rst b/source/lang/api/delay.rst
index 9ef06a0..30bd436 100644
--- a/source/lang/api/delay.rst
+++ b/source/lang/api/delay.rst
@@ -42,17 +42,16 @@ Example
::
- int ledPin = 13; // LED connected to pin 13
-
void setup() {
- pinMode(ledPin, OUTPUT); // sets the digital pin as output
+ // set up the built-in LED pin for output:
+ pinMode(BOARD_LED_PIN, OUTPUT);
}
void loop() {
- digitalWrite(ledPin, HIGH); // sets the LED on
- delay(1000); // waits for a second
- digitalWrite(ledPin, LOW); // sets the LED off
- delay(1000); // waits for a second
+ digitalWrite(BOARD_LED_PIN, HIGH); // sets the LED on
+ delay(1000); // waits for a second
+ digitalWrite(BOARD_LED_PIN, LOW); // sets the LED off
+ delay(1000); // waits for a second
}
.. _lang-delay-seealso:
diff --git a/source/lang/api/digitalwrite.rst b/source/lang/api/digitalwrite.rst
index 376cbc3..bae8db9 100644
--- a/source/lang/api/digitalwrite.rst
+++ b/source/lang/api/digitalwrite.rst
@@ -28,9 +28,10 @@ more slowly as an output than the other pins.
Example
-------
-The following example sets pin 13 to ``HIGH``, makes a one-second-long
-delay, sets the pin back to ``LOW``, and delays again, causing a
-blinking pattern (you could also use :ref:`lang-toggleled`)::
+The following example sets the built-in LED pin to ``HIGH``, makes a
+one-second-long delay, sets the pin back to ``LOW``, and delays again,
+causing a blinking pattern (you could also use
+:ref:`lang-toggleled`)::
void setup() {
pinMode(BOARD_LED_PIN, OUTPUT); // sets the digital pin as output