The Boolean data type can contain one of two possible values, true or false. The following example shows how to declare a variable to be of the Boolean type:
boolean myBool = true;
The preceding code declares a variable named myBool of the Boolean type and sets an initial value of true. Boolean types are used a lot within a standard Arduino program and all comparison operations, as we will see later in this chapter, return a Boolean value.