This block works for both EV3 Robot and Ruby Robot!
The Logical Operator block returns a Boolean value (True/False) based on the result of two (or more) expressions.
For example, using the Logical Operator block, the following program checks two expressions - that the Touch sensor is not pressed and that the Ultrasonic sensor is far from an obstacle. If both those expressions are true, the robot drives forward.
There are three configurations for the Logical Operator block that can be selected using its drop-down menu:
|and||Returns a true value if both operands (expressions) are true.|
|or||Returns a true value if at least one of the operands (expressions) are true.|
|xor||Returns a true value if only one of the operands (expressions) are true, or returns a false value if both operands are either true or false.|