Hi thanks for the reply.
I need to work in the order of milliseconds, i was just testing in seconds with the LED so i could take the time with a chrono watch.
Now I am using the filename for storing the information of the gain and exposure using sensor.get_gain_db(), sensor.get_exposure_us(), while the sensor.get_exposure_us() works when I input 3000 the output is 2990 and when i input 10000 is 9988 (assuming is because 16 bit approx conversion)
example of the file name
Does not matter how I change the gain that I always have the same gain = 17.78586, does not matter if I change to 10, or 100 or 0.1. Do you know what could be wrong in my code?
import pyb, machine, sensor, image, pyb, os, time
RED_LED_PIN = 1
BLUE_LED_PIN = 3
sensor.set_auto_gain(False, gain_db = gain)
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.BAYER) # or sensor.Bayer
sensor.set_framesize(sensor.VGA) # or sensor.VGA (or others)
sensor.skip_frames(time = 1000) # Let new settings take affect.
sensor.set_auto_exposure(False, exposure_us = Exp)
sensor.skip_frames(time = 1000) # Give the user time to get ready.
newName='OpenMV_r210g000b000_fullsize_gain'+gainrs+'msec'+timexp # Image file name based on RTC
# Use current date to get a text file name.
return newName + ".bin"
# Get full path for writing.
name = get_filename_datetime()
path = name
with open(path, "wb") as f:
img = sensor.snapshot()