Execute the Code
Before you can upload the sketch to the PULSE, remember to check your
connections. The Ultrasonic Sensor should be in D3. Upload the sketch. The green
LED will light up, indicating the code is ready to execute. When this has occurred,
disconnect the USB cable and set the Codee Bot on the floor.
When running this code, set an obstacle in front of your robot at a distance well
outside the 25-centimeter detection range. Cardboard boxes work well for this
purpose. You do not want anything too heavy that could cause damage to your
robot just in case your robot crashes into it.
Activity 14: Avoiding Obstacles
Introduction
For this activity, you are going to expand on the if-else block by adding actions. This
will enable the PULSE Codee Bot to avoid obstacles in its path.
Open the Program
Let’s start by looking at the example sketch. Open the sketch by selecting
Examples > Activity_14. A new sketch window will open titled Activity_14
(Figure 65).
Figure 65
Parts Needed
116 Building and Coding the PULSE CodeeBot