
21-02-2011, 15:30
|
 |
Software Engineer
 FRC #0492 (Titan Robotics)
Team Role: Mentor
|
|
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
|
|
|
Re: Programming Light Sensor
To debug the light sensors: - Make sure the light sensors are powered (i.e. any of the LEDs are lit -green, yellow or orange).
- Make sure the light sensors are calibrated. The green LED should lit up if the sensor is on carpet. The yellow LED should lit up if the sensor is on the line. If the orange LED is lit up along side the yellow, it's even better (good contrast margin). If the LEDs don't lit up as described above, you need to tune the screw on top of each sesnor until it behaves as above.
- Make sure the sensor signal wires are connected to a separate digital input channel for each sensor. If you want to read a 1 for on-the-line and 0 for on-the-carpet, use the white wire as the signal wire. If you want the reverse, use the black wire.
- Assuming you are connecting using the white wire, test your setup so that when the light sensor has the green LED lit, you should read a 0. When the yellow or yellow+orange LEDs are lit, you should read a 1.
__________________
|