[an error occurred while processing this directive]
HOME
FUNDAMENTALS
SETUP
MOVEMENT
REMOTE CONTROL
SENSING
[an error occurred while processing this directive] [an error occurred while processing this directive]
Exit
- :
[an error occurred while processing this directive]
Check Your Understanding:
1. How does an ‘IF’ statement differ from a while loop?
An IF statement is always run once; a WHILE loop is run as long as the condition in the parentheses is true
A WHILE loop is always run once; An if Statement is run as long as the condition in the parentheses is true
An IF statement can only be run while the condition is false; the WHILE loop can only be run as long as the condition is false
An IF statement is always longer than a WHILE statement
2. How is the robot able to determine it is veering?
A touch sensor on the side of the robot is pressed when the robot runs into a side wall
A light sensor on the front of the robot senses that it is traveling over a black line
The left and right encoders are not the same value
It can’t – the programmer has to tell it that it is veering
3. How can the robot self-correct its forward motion?
Increase the power to the wheel with the most encoder counts
Decrease the power to the wheel with the least encoder counts
Assure that the power to both motors is the same
Decrease the power to the wheels with the most encoder counts
4. An IF-ELSE statement allows the robot to run two different portions of code at the same time.
Trues
False
5. An IF-ELSE statement allows the robot to run one portion of code if the IF statement is false and another portion of code if it is true.
Trues
False
if-else
Statements
Boolean Logic Pt 1
Boolean Logic Pt 2