Background
For your fifth sketch, you will use the Ultrasonic Sensor, which sends out pulses that
measure the distance from the sensor to the object. You will use the same logic
block from the previous activity.
Instead of measuring light, this sensor will measure distance. Depending on the
distance of the object from the sensor, a red or yellow LED will light up on the
PULSE controller.
Execute the Code
Before you can upload the sketch to the PULSE, remember to check your
connections. Keep in mind that you added a new connection in digital sensor port
D3 with the Ultrasonic Sensor. Upload the sketch.
With the sensor lying flat on the desk pointed up, press the green Start button to
execute the code.
Hold your hand above the sensor. Move it up and down. Watch what happens to
the LEDs on the PULSE controller. Press the Stop/Reset button when you are ready
to stop the sensor.
42 Getting Started Activities