I have a little black and white video camera, and I want to add some IR LEDs to light up the night. I would like to have them adjust down when something is real close to the camera...usually it will just white out the picture. BCJKiwi was kind enough to explain how to auto-adjust the brightness of an LED with this code:
main:
readadc10 4,w1
pwmout 2, 99, w1
goto main
I am grateful for the help too...thanks again. But I want the LEDs to dim when the light gets too bright...this works opposite...the brighter the light gets the brighter LEDs get. After searching, and reading a lot of unrelated but interesting things, I never found what I needed to learn.
I used my 08M school experimenter board to try it, is there another way to use the LDR..or another way to write the code???
Oh, I found out my hearing is not as good as my wife's...I could not hear the speaker till she came in complaining about the loud squeal coming from in here ...
edit: How come I think of things after asking for help???
if w1 = this then PWM that....but this sure will be a long code huh. Anything better???
main:
readadc10 4,w1
pwmout 2, 99, w1
goto main
I am grateful for the help too...thanks again. But I want the LEDs to dim when the light gets too bright...this works opposite...the brighter the light gets the brighter LEDs get. After searching, and reading a lot of unrelated but interesting things, I never found what I needed to learn.
I used my 08M school experimenter board to try it, is there another way to use the LDR..or another way to write the code???
Oh, I found out my hearing is not as good as my wife's...I could not hear the speaker till she came in complaining about the loud squeal coming from in here ...
edit: How come I think of things after asking for help???
if w1 = this then PWM that....but this sure will be a long code huh. Anything better???
Last edited: