aboutsummaryrefslogtreecommitdiffstats
path: root/source/lang/cpp/bitwisemath.rst
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/cpp/bitwisemath.rst
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/cpp/bitwisemath.rst')
-rw-r--r--source/lang/cpp/bitwisemath.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/lang/cpp/bitwisemath.rst b/source/lang/cpp/bitwisemath.rst
index 59794ba..cfe34f2 100644
--- a/source/lang/cpp/bitwisemath.rst
+++ b/source/lang/cpp/bitwisemath.rst
@@ -109,21 +109,21 @@ The ^ operator is often used to toggle (i.e. change from 0 to 1, or 1
to 0) some of the bits in an integer expression. In a bitwise OR
operation if there is a 1 in the mask bit, that bit is inverted; if
there is a 0, the bit is not inverted and stays the same. Below is a
-program to blink digital pin 13 (the LED pin on Maple)::
+program to toggle the built-in LED pin (you can also accomplish this
+with :ref:`lang-toggleled`)::
- // Blink Maple LED pin
+ // Toggle built-in LED pin
- int led_pin = 13;
int toggle = 0;
// demo for Exclusive OR
void setup(){
- pinMode(led_pin, OUTPUT);
+ pinMode(BOARD_LED_PIN, OUTPUT);
}
void loop(){
toggle = toggle ^ 1;
- digitalWrite(led_pin, toggle);
+ digitalWrite(BOARD_LED_PIN, toggle);
delay(100);
}