Lesson: 20L ESR Touching Objects
In this lesson, students learn how to use the Wait Block with a Touch Sensor to have Riley detect when and obstacle is encountered.
1) If you need a review of how the Wait-for-Touch Block can be used to turn off a motor, watch this video from Unit 1 again:
2) Watch this video to learn how to use a Wait-for-Touch Block to allow Riley to respond when an obstacle is encountered :
3) Start the video again and pause so you can add a Touch Sensor to the front of Riley as shown and follow along to have Riley Wait for the Touch Sensor.
4) Try programming Riley to:
- Drive straight forward until something is touched.
(Hint: Add a short axle with a gear attached to the front of the Touch Sensor, or build fancier bumper, to improve obstacle detection) - Then have Riley back up and turn 90 degrees.
- Then have Riley go forward until it touches something again.
- Then have the robot back up and turn 90 degrees.
5) Try using both Move Steering and Move Tank Blocks to make Riley turn.
6) Can you use a Loop to repeat this behavior?
7) Answer these questions:
Why is the first Move Block just “On” and the other two “Rotations” and “Degrees”?
What does the Loop Block do?
- Log in to post comments