True false

From Microduino Wiki
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 is case-sensitive.

[Return to Arduino Syntax Manual]