True false

From Microduino Wiki
Revision as of 05:41, 16 August 2016 by Fengfeng (talk) (Created page with "true|false Logical layer definition true and false(Boolean constant)<br> There are two constants in Arduino representing true and false:true and false.<br> *'''false<br...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

true|false Logical layer definition true and false(Boolean constant)

There are two constants in Arduino representing true and false:true and false.

  • false

During these two constants, false is easy to be defined, and false is defined as 0(zero).

  • true

True is usually defined as 1, which is right, while true has broader definition. In Boolean sense, any nonzero integer is true. So -1, 2 and -200 are all defined as true. You need to pay attention to that constant true and false are different from HIGH, LOW, INPUT and OUTPUT, because they are all lowercase.

Note that arduino case-sensitive.

[Return to Arduino Syntax Manual]