WHAT ARE BOOLEAN OPERANDS?

WHAT ARE BOOLEAN OPERANDS?

Question:

What are boolean operands, and how do I use them in RobotC?

Solution:

Boolean Operands are used in programming because there are only two conditions that can be true. (Digital) On or Off, 1 0r 0, True or false…  With that being said, there are many that can be used and there is a chart shown below. This chart came right from a robotc reference. For a more in depth discussion go HERE.

Here’s an example of how to use AND with an until command to wait for two conditions to be true. In this example, the Until command acts as a bouncer, and will not let the program move forward until both conditions are met. In this case, it is waiting until the Sonar sensor value falls within the range of 1 to 3.

Boolean_2

boolean

 Boolean_4

 

 

 1,786 total views,  4 views today

CHRIS HURD

JIM HANSON



Chris and Jim CIM
© Copyright 2020

Visits: 4,525,967