Qu-Bot, A Quickly Programmable Robot User’s Manual
Page
38
of
52
<=
Less than or Equal to
>=
Greater than or Equal to
6.1.1.3. Operand2
Value is to be typed or selected by dropdown menu.
6.1.1.4. Logical operator
&&
Logical AND (Both condition must be true)
||
Logical OR (Any one condition should be true)
These operators are used between two conditions.
6.1.1.5. Condition structure
Condition structure will be
operand1, operator, and operand2.
Operand1 will be compared to operand2 as per operator and condition result will
be returned.
If you have used a Logical operator the structure will be
condition1, Logical
Operator and condition2
.
There can be multiple conditions separated by logical operators.
Some examples of conditions
LDR Value < 100
Ambient light intensity Less than 100 (0-99)
BOTTOM CENTER == 1
Line follower center censor is on
Switch1 != 1
Switch1 not pressed
LEFT MOTOR COUNT > 1000
Left motor has moved more than 1000
counts forward
FRONT LEFT == 1
Obstacle left sensor senses obstacle
Switch1 == 1 AND Switch2 == 1
AND Switch3 == 1
All three switches are pressed
Switch1 == 1 OR Switch2 == 1 OR
Switch3 == 1
Any switch is pressed
LDR Value < 50 OR LDR Value >
100
Ambient light intensity is between (0-49 &
101-255). Where 255 is max value.
6.1.3. Function of IF, ELSE IF, ELSE, ENDIF
When code flow encounters IF(Condition) or ELSEIF(Condition) block it checks for
the condition.
If condition is true code flow will execute items in that block and move directly to
ENDIF.
If condition is false it will search for next ELSEIF or ELSE block.
If none of the IF or ELSEIF condition is true and you have encountered ELSE then
execute items in ELSE block.