The Distance Sensor, shown in Figure 8-1, measures the distance to an object in front of it. It can, for example, tell a robot that it may be about to run into something. Alternatively, it can trigger some action when an object gets close. This chapter will describe how to work with these distance sensing functions, first with a new type of tape measure. Then the chapter project will build a cannon that scans an area to monitor for a target to shoot at.
A photograph of a distance sensor. It has two circular mesh projections ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.