aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/arduino/else.rst
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-01-24 23:23:29 -0500
committerPerry Hung <iperry@gmail.com>2011-01-24 23:23:29 -0500
commitc48689d34809943a5907884bd287cea9ae275352 (patch)
treed49ff06b0d4b81f6ab0eac8060d178ce7542476c /docs/source/arduino/else.rst
parent64431fd4b59cb8656365f1fad5f679cd4d756239 (diff)
parenta9b2d70bc7799ca96c1673b18fe3012b1a4dd329 (diff)
downloadlibrambutan-c48689d34809943a5907884bd287cea9ae275352.tar.gz
librambutan-c48689d34809943a5907884bd287cea9ae275352.zip
Merge remote branch 'leaf/master'
Diffstat (limited to 'docs/source/arduino/else.rst')
-rw-r--r--docs/source/arduino/else.rst73
1 files changed, 0 insertions, 73 deletions
diff --git a/docs/source/arduino/else.rst b/docs/source/arduino/else.rst
deleted file mode 100644
index f278a0d..0000000
--- a/docs/source/arduino/else.rst
+++ /dev/null
@@ -1,73 +0,0 @@
-.. _arduino-else:
-
-if / else
-=========
-
-**if/else** allows greater control over the flow of code than the
-basic **if** statement, by allowing multiple tests to be grouped
-together. For example, an analog input could be tested and one
-action taken if the input was less than 500, and another action
-taken if the input was 500 or greater. The code would look like
-this:
-
-
-
-::
-
- if (pinFiveInput < 500)
- {
- // action A
- }
- else
- {
- // action B
- }
-
-
-
-**else** can proceed another **if** test, so that multiple,
-mutually exclusive tests can be run at the same time.
-
-
-
-Each test will proceed to the next one until a true test is
-encountered. When a true test is found, its associated block of
-code is run, and the program then skips to the line following the
-entire if/else construction. If no test proves to be true, the
-default **else** block is executed, if one is present, and sets the
-default behavior.
-
-
-
-Note that an **else if** block may be used with or without a
-terminating **else** block and vice versa. An unlimited number of
-such **else if** branches is allowed.
-
-
-
-::
-
- if (pinFiveInput < 500)
- {
- // do Thing A
- }
- else if (pinFiveInput >= 1000)
- {
- // do Thing B
- }
- else
- {
- // do Thing C
- }
-
-Another way to express branching, mutually exclusive tests, is with
-the `switch case <http://arduino.cc/en/Reference/SwitchCase>`_
-statement.
-
-
-
-See also:
----------
-
-`switch case <http://arduino.cc/en/Reference/SwitchCase>`_
-