diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-12-21 10:27:37 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-12-21 10:27:37 -0500 |
commit | c45bccad44187da27505cf5808424e709e3f54a1 (patch) | |
tree | 18a459a50f8d0551ba046e30462c93999d982725 /docs/source/arduino/boolean.rst | |
parent | 84fd2532a7f23d20354ff590790b3f892cb7e7d7 (diff) | |
parent | d5ad2a27f4e69e6cc9324331945937c983c30366 (diff) | |
download | librambutan-c45bccad44187da27505cf5808424e709e3f54a1.tar.gz librambutan-c45bccad44187da27505cf5808424e709e3f54a1.zip |
Merge branch 'master' into debug-serialusb.
Chose debug-serialusb version in cases of conflict.
Conflicts:
libmaple/usb/usb_callbacks.c
Diffstat (limited to 'docs/source/arduino/boolean.rst')
-rw-r--r-- | docs/source/arduino/boolean.rst | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/docs/source/arduino/boolean.rst b/docs/source/arduino/boolean.rst deleted file mode 100644 index f109bdb..0000000 --- a/docs/source/arduino/boolean.rst +++ /dev/null @@ -1,94 +0,0 @@ -.. _arduino-boolean: - -Boolean Operators -================= - -These can be used inside the condition of an -`if <http://arduino.cc/en/Reference/If>`_ statement. - - - -&& (logical and) -~~~~~~~~~~~~~~~~ - -True only if both operands are true, e.g. - -:: - - if (digitalRead(2) == HIGH && digitalRead(3) == HIGH) { // read two switches - // ... - } - -is true only if both inputs are high. - - - -\|\| (logical or) -~~~~~~~~~~~~~~~~~ - -True if either operand is true, e.g. - -:: - - if (x > 0 || y > 0) { - // ... - } - -is true if either x or y is greater than 0. - - - -! (not) -~~~~~~~ - -True if the operand is false, e.g. - -:: - - if (!x) { - // ... - } - -is true if x is false (i.e. if x equals 0). - - - -Warning -------- - -Make sure you don't mistake the boolean AND operator, && (double -ampersand) for the bitwise AND operator & (single ampersand). They -are entirely different beasts. - - - -Similarly, do not confuse the boolean \|\| (double pipe) operator -with the bitwise OR operator \| (single pipe). - - - -The bitwise not ~ (tilde) looks much different than the boolean not -! (exclamation point or "bang" as the programmers say) but you -still have to be sure which one you want where. - - - -Examples --------- - -:: - - if (a >= 10 && a <= 20){} // true if a is between 10 and 20 - - - -See also --------- - - -- `& <http://arduino.cc/en/Reference/BitwiseAnd>`_ (bitwise AND) -- `\| <http://arduino.cc/en/Reference/BitwiseAnd>`_ (bitwise OR) -- `~ <http://arduino.cc/en/Reference/BitwiseXorNot>`_ (bitwise NOT -- `if <http://arduino.cc/en/Reference/If>`_ - - |