Learning Target: Learn how the ultrasonic sensor works and use it to detect objects ahead
Lesson Sequence:
- Begin by watching the Ultrasonic video:
https://cs4hsrobots.appspot.com/unit?unit=25&lesson=55
- Attach the Ultrasonic sensor to your Domabot (see page 9 of the build instructions) and connect it to port 4
- Write a program to:
- Move forward
- Detect an object that is less than 20 cm away
- Say “object detected”
- Stop
- Write a program similar to the one demonstrated in the video:
- Say “Hooray”
- Move forward while playing a few tones
- When an object is less than 25 cm away, stop
- Say “Object detected”
- Click here for Robot Project 4 Challenge
- Write a program using the ultrasonic sensor to walk within a box without hitting the side walls