User Manual
36
Test for Light Follower
Let’s test the light follower first.
Get into the directory example
cd ~/SunFounder_PiCar-S/example/
Run the test code
python test_light_module.py
pi@raspberrypi:~ $ cd ~/SunFounder_PiCar-S/example/
pi@raspberrypi:~/SunFounder_PiCar-S/example $ python test_light_module.py
[237, 233, 237]
[236, 230, 236]
[232, 238, 246]
[237, 240, 251]
[145, 175, 200]
[228, 234, 74]
[219, 226, 23]
[220, 192, 21]
[233, 238, 23]
[236, 241, 22]
Expose the phototransistors to the light spot of the flashlight. When you increase the light intensity,
more LEDs light up, and the ouput values decrease. Here we can rotate the blue adjustable resistor
to change the values under the same light luminance. If there is no light, only one LED will light up
with the output value as 255; if the light is the brightest, all the LED will light up, and it would be
better to adjust the output value to 10-25 under this circumstance.
Place the module in an open field with even light exposure so the experiment can be free of the
interference of unsteady ambient light thus the sensor is more sensitive. Check this way: expose