I am a newbie in arduino programming and I would like to use it to trigger a LED and a camera. For correcting for dark noise and stray light in the camera, I was thinking to take two pictures with LED completely OFF and two pictures with LED modulated ON and OFF at a high frequency. The high frequency modulation of the LED is mainly for avoiding heating since I am going to run it with quite a high current. A scheme of the signals I would like to send to both the camera (Dig 1) and the LED (Dig 2) is shown on the figure in attachment. Both trigger on the high level of the digital signals. I read about using port manipulation to get well synchronized and simultaneous output for the LED and camera, and I found this link http://www.jeremyblum.com/2010/09/05/driving-5-speakers-simultaneously-with-an-arduino/, which explain how to generate 5 digital signals with different frequencies using timers and interrupts. So I am well equipped to start BUT I do not know at all how to stop the generation of the LED signal as explained on my drawing. I guess I would have to use another interrupt, or make a kind of digital mask but I do not see how.
Any ideas on how to do that? or any link ?
Thanks in advance,
synchro_LED_Camera.bmp (1.48 MB)