162
162
Conditional Programming
●
Now it is time to use the ultrasonic sensor
to do collision avoidance.
●
The 'if' command will be used to test if the
robot will collide with an object.
●
The format for the if statement is shown to
the right.
●
Multiple statements can be inserted
between the brackets and will be
executed if the condition is true.
●
To test for equals, use '=='
●
else allows two sets of codes to be
executed depending on the condition.
if(a < c) {
execute code here
}
if(a == c) {
execute this code
}
if(a > c) {
execute this code
} else {
otherwise execute this code
}
Summary of Contents for StenBOT Rover Kit
Page 1: ...1 StenBOT Rover Kit Stensat Group LLC Copyright 2013 ...
Page 4: ...4 Overview ...
Page 22: ...22 22 Assembly ...
Page 58: ...58 58 Processor Board and Arduino Software ...
Page 118: ...118 118 Completing The Robot Motion ...
Page 138: ...138 138 Digital Signal Connections ...
Page 166: ...166 166 Remote Control ...