On 3/19/08, David VanHorn wrote: > Just for laughs, you could increase the LED current when you detect > "white" and decrease it when you detect "black". Actually this works as kind of hysteresis. I believe similar methods are used in photoelectric proximity switches. > I've also done sensors where I drove the LED from the phototransistor > so as to get a constant current in the transistor, like 1mA, and used > the LED drive voltage to determine the state of the system. This > also detects failed components since you can't close the servo loop if > the LED or phototransistor fail. That is similar to how a laser diode works. Xiaofan -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist