Dear all,
I try to understand how works the gain in the OV7725 camera, and i stopped on the gain ceiling.
To set the gain ceiling there is 2 ways in python :
- sensor.set_gainceiling(4)
- sensor.set_auto_gain(True, gain_db_ceiling=4)
which both write at the COM9 register but the c language codes do it in 2 different ways.
Here is the test code :
import sensor
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 500)
sensor.set_gainceiling(4)
print("set_gainceiling : ", hex(sensor.__read_reg(0x14)))
sensor.set_auto_gain(True, gain_db_ceiling= 4)
print("set_auto_gain : ", hex(sensor.__read_reg(0x14)))
The result for 4db is ;
- set_gainceiling : 0x11 (this is right)
- set_auto_gain : 0x1 (this is not right)
Do i miss something ?
Thanks