RT1062 Triggering a flashing light when the camera captures an image

I’ve been trying to set up a system that captures a sequence of images with very short exposure times. This, of course, requires a bright light to flash at exactly the right time to take the photo. I’m trying to take photos at set frame rates (1 to 15 FPS) which seems to compound the problem. I do not want to use ImageIO because of the extra processing steps afterwards, I’d like to have a sequence of separate photos saved directly to the uSD card.

The H7plus model could only trigger a flashing light separately from the photo. I can program a GPIO pin to turn on, then take the photo, then turn the GPIO pin off. This method requires putting in delays to make sure the frame rate stays as desired. I can calculate them, but realistically I just have to experiment and see what works. If the camera takes slightly longer than necessary for a photo then the delay is all wrong. Any changes that are made leads to retesting everything and it’s an annoying mess in general.

I can also create a PWM signal out of one of the GPIO pins which can trigger the light. It works great for flashing the light, but if the camera doesn’t start taking photos at exactly the right time the result is useless.

I was under the impression, and I might be wrong, that the RT1062 was capable of triggering a GPIO pin directly when taking a photo. No extra delay calculations, no testing the timing of multiple things, no making sure the camera starts when the light does. I was expecting with some setup I could, more or less, give a snapshot() command and it would take a flash photo. I could program the bare minumum calculations to get the desired frame rate and I’m done.

Is there any way to actually do that? I’ve seen ways to set the camera to be triggered by an external input but I don’t see a way to make the snapshot() command do anything other than take a picture.

If you are using the global shutter sensor snapshot literally triggers the camera to take a picture. So, you just turn a GPIO pin on before you call snapshot.

Just make sure to put the camera into triggered mode. Otherwise, it will be streaming an generating images all the time.

The OV5640 doesn’t have an API for you to trigger it. The camera is technically capable of this… but, we’ve never implemented it. However, you can trigger the OV5640 via register reads/writes which you have access to from python via the sensor driver. So, you could read the datasheet for the camera, try to put it into triggered mode, and trigger it before snapshot().