Black/White Infrared tracking sensor can sense black/white and send the color as 1/0 digital data to computer. This kind of tracking sensor plays a key role in may robot car line tracking project.
In this lesson, we will teach you how to use tracking sensor to send black/white signal to Raspberry Pi and display the result in raspberry Pi terminal.
Tracking SensorRaspberry Pi
Run following command download and install python code:
After running the code, put the sensor above a white background, the color LED will ON and the terminal screen will show "white detected!".
Now put the sensor onto black ground or simply put it far away from white background, LED will OFF and terminal screen will show "Black detected!".