Running the project

When we run this project, the output should look similar to the following screenshot:

This screenshot shows that an object tripped the infrared sensor twice, where IR Detected is printed to the serial console and the crash sensor once, where Collision Detected was printed to the serial console. It also shows the distance that the rangefinder returned as the closest object.

Get Mastering Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.