© Joseph Coburn 2020
J. CoburnBuild Your Own Car Dashboard with a Raspberry Pihttps://doi.org/10.1007/978-1-4842-6080-7_10

10. Fog and Reverse Sensors

Chapter goal: Detect when the fog lights are on, or when the car is in reverse. Refactor sensors class to reduce duplication.
Joseph Coburn1 
Alford, UK

This project implements two further sensors to detect when the car is in reverse gear, or the fog lights are on. These are two independent sensors, but they are both identical in terms of code and hardware. By detecting when the reversing light is enabled, it’s possible to identify when the car is in the reverse gear. Later on, you’ll use this sensor to change the display to provide more value for reversing. For the fog light sensor, this is only ...

Get Build Your Own Car Dashboard with a Raspberry Pi: Practical Projects to Build Your Own Smart Car 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.