User Manual
37
the light follower module under the natural light (or other bright conditions) to get the output value;
then shine the flashlight on the phototransistors to get another output value. A place with a gap
of 20+ between these two values would be a better choice, so that we can get an obvious effect
when the car follows light.
Step 3 Run the Code
Get into the directory
cd ~/SunFounder_PiCar-S/example
Run the code
python light_follower.py
Calibrate the light following
The car will enter the light following configuration mode when we run the code above. It will keep
turning to the right in a circle to gather the information of light condition in different directions. So
just place the car in an open field and wait.
Picar-S follows light
When the calibration is done, the car will stop temporarily. Shine a flashlight on the light follower
module, and the car will just follow the light spot as you moves it.
Software Flow
1. Light-sensitive sensors need to be calibrated before actual use because of complex light
conditions in the environment. It gathers the information of the ambient light luminance. The car
can follow light only when the light source is brighter than the surroundings.