diff options
author | Perry Hung <iperry@gmail.com> | 2011-01-24 23:23:29 -0500 |
---|---|---|
committer | Perry Hung <iperry@gmail.com> | 2011-01-24 23:23:29 -0500 |
commit | c48689d34809943a5907884bd287cea9ae275352 (patch) | |
tree | d49ff06b0d4b81f6ab0eac8060d178ce7542476c /docs/source/arduino/booleanvariables.rst | |
parent | 64431fd4b59cb8656365f1fad5f679cd4d756239 (diff) | |
parent | a9b2d70bc7799ca96c1673b18fe3012b1a4dd329 (diff) | |
download | librambutan-c48689d34809943a5907884bd287cea9ae275352.tar.gz librambutan-c48689d34809943a5907884bd287cea9ae275352.zip |
Merge remote branch 'leaf/master'
Diffstat (limited to 'docs/source/arduino/booleanvariables.rst')
-rw-r--r-- | docs/source/arduino/booleanvariables.rst | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/docs/source/arduino/booleanvariables.rst b/docs/source/arduino/booleanvariables.rst deleted file mode 100644 index 3bbe72a..0000000 --- a/docs/source/arduino/booleanvariables.rst +++ /dev/null @@ -1,53 +0,0 @@ -.. _arduino-booleanvariables: - -boolean -======= - -A **boolean** holds one of two values, -`true <http://arduino.cc/en/Reference/Constants>`_ or -`false <http://arduino.cc/en/Reference/Constants>`_. (Each boolean -variable occupies one byte of memory.) - - - -Example -------- - -:: - - int LEDpin = 5; // LED on pin 5 - int switchPin = 13; // momentary switch on 13, other side connected to ground - - boolean running = false; - - void setup() - { - pinMode(LEDpin, OUTPUT); - pinMode(switchPin, INPUT); - digitalWrite(switchPin, HIGH); // turn on pullup resistor - } - - void loop() - { - if (digitalRead(switchPin) == LOW) - { // switch is pressed - pullup keeps pin high normally - delay(100); // delay to debounce switch - running = !running; // toggle running variable - digitalWrite(LEDpin, running) // indicate via LED - } - } - - - - - - -See also --------- - - -- `constants <http://arduino.cc/en/Reference/Constants>`_ -- `boolean operators <http://arduino.cc/en/Reference/Boolean>`_ -- `Variable Declaration <http://arduino.cc/en/Reference/VariableDeclaration>`_ - - |