I am trying to have a LED sense light. The anode and cathode are connected to pins on a microcontroller.
Here is what is looping:
Set cathode pin to output
Turn cathode high and anode low (to charge internal capacitor in LED)
Wait 1 millisecond for capacitor to charge
Set cathode pin to input
Wait <<any amount of time, from 1ms to several seconds>>
Read values from ADC
No matter what, I get VCC (5v) as the output from the ADC, and I verified it with a multimeter. Any ideas on why this is happening?
Here is what is looping:
Set cathode pin to output
Turn cathode high and anode low (to charge internal capacitor in LED)
Wait 1 millisecond for capacitor to charge
Set cathode pin to input
Wait <<any amount of time, from 1ms to several seconds>>
Read values from ADC
No matter what, I get VCC (5v) as the output from the ADC, and I verified it with a multimeter. Any ideas on why this is happening?