Difference between revisions of "True false"

From Microduino Wiki
Jump to: navigation, search
(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...")
 
 
Line 10: Line 10:
 
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. <br>
 
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. <br>
  
Note that arduino case-sensitive.<br>
+
Note that arduino is case-sensitive.<br>
  
 
[[https://wiki.microduino.cc/index.php/Arduino_Syntax_Manual Return to Arduino Syntax Manual]]
 
[[https://wiki.microduino.cc/index.php/Arduino_Syntax_Manual Return to Arduino Syntax Manual]]

Latest revision as of 05:45, 16 August 2016

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]