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

9. Light Sensor

Chapter goal: Install a light sensor and read its state into your application. Begin test-driven development and enhance your unit testing skills.
Joseph Coburn1 
(1)
Alford, UK
 

For this project, you’ll use a light sensor to read in the available light, and make an assessment – daytime or nighttime. This is another quick project, but it serves a valuable purpose. Not only is it useful for your car to inform you that it’s getting dark outside, but it is the valuable foundation for any of your own future projects. You could expand this to switch on your headlights automatically or turn on the cabin lights if it’s dark ...

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.