aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/arduino/booleanvariables.rst
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@mit.edu>2010-11-28 11:23:33 -0500
committerMarti Bolivar <mbolivar@mit.edu>2010-11-28 11:23:33 -0500
commit5e587be27a7c3bd854b686952a5c9637a2432ff0 (patch)
tree09d4ceeb46f19287ee874a24516c68be90c9ad8e /docs/source/arduino/booleanvariables.rst
parentdb4ff6ba53e9b702c77411ae19cd53d914a675de (diff)
downloadlibrambutan-5e587be27a7c3bd854b686952a5c9637a2432ff0.tar.gz
librambutan-5e587be27a7c3bd854b686952a5c9637a2432ff0.zip
reorganized all the arduino/ docs into a lang/ subdirectory since
they're properly CC attributed now.
Diffstat (limited to 'docs/source/arduino/booleanvariables.rst')
-rw-r--r--docs/source/arduino/booleanvariables.rst55
1 files changed, 0 insertions, 55 deletions
diff --git a/docs/source/arduino/booleanvariables.rst b/docs/source/arduino/booleanvariables.rst
deleted file mode 100644
index a5f2c51..0000000
--- a/docs/source/arduino/booleanvariables.rst
+++ /dev/null
@@ -1,55 +0,0 @@
-.. highlight:: cpp
-
-.. _arduino-booleanvariables:
-
-Booleans
-========
-
-A **boolean** holds one of two values, :ref:`true
-<arduino-constants-true>` or :ref:`false <arduino-constants-false>`.
-On a Maple, each boolean variable occupies one byte of memory, and has
-type ``bool``.
-
-.. warning::
-
- On an Arduino, the type ``boolean`` is also provided. While the
- Maple also has this type for compatibility, **its use is strongly
- discouraged**. The ``bool`` type is a standard part of C++, while
- ``boolean`` is a non-standard extension that serves no purpose.
-
-Example
--------
-
-::
-
- int ledPin = 13; // LED on pin 13
- int switchPin = 12; // momentary switch on 12, other side connected to ground
-
- // running is a boolean variable:
- bool 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
---------
-
-
-- :ref:`Boolean constants <arduino-constants-bool>`
-- :ref:`Boolean operators <arduino-boolean>`
-- :ref:`Variables <arduino-variables>`
-
-
-.. include:: cc-attribution.txt \ No newline at end of file