I am trying to write code that will take 4 analog inputs from 4 photodiodes, read them into an array, and then output the value from the array through a pwm pin. The arduino then acts like a little camera, projecting whatever the light levels are on the photodiodes, to the LED’s I have hooked up. I have written code and It generally works pretty well, unless the light becomes very bright, or if I try to hook up a pull down resistor to my photodiodes. (Right now they are reverse biased and hooked directly to the analog inputs). Whenever the light becomes too bright, the LED’s stop lighting up at all, and will have little flickers of light randomly. The same thing happens when I try to hook up a pull down resistor. It also seems that when the light starts to get brighter the LED’s will pulse slowly, same with the pull down resistor. My computer isn’t letting me paste it for some strange reason so I have attached it to this post.
AnalogCamera.pde (1.04 KB)