Data Sheet
104 : circuit 5c
PROGRAM OVERVIEW
If the switch is turned on,
Then start sensing the distance.
A: If no obstacle is detected, then drive forward.
B: If an obstacle is detected, stop, back up, and turn right.
C: If no obstacle is detected, start driving forward again.
TROUBLESHOOTING WARNING
HVAC systems in offices and schools have been known to interfere with the
performance of the ultrasonic distance sensor. If you are experiencing sporadic
behavior from your circuit, check your surroundings. If there are numerous air
ducts in the room you are using, try moving to a different room that does not have
ducts. The airflow from these ducts can interfere with the waves sent from the
sensor, creating noise and resulting in bad readings.
WHAT YOU
SHOULD SEE
When the switch is turned off,
the robot will sit still. When
the switch is turned on, the
robot will drive forward until
it senses an object. When it
senses an object in its path, it
will reverse and then turn to
avoid the obstacle.
Open the Arduino IDE
Connect the RedBoard to a USB port on your computer.
Open the Sketch:
File > Examples > SIK_Guide_Code-V_4 > SIK_CIRCUIT_C-AUTONOMOUS ROBOT
Select UPLOAD to program the sketch on the RedBoard.
SIK v4 Book Oct 13.indb 104 10/18/17 10:03 AM