O'Reilly logo

Mastering Arduino by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Boolean

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required