ArduCAM / ArduCAM_USB_Camera_Shield

This is the repository for ArduCAM USB Camera Shield
126 stars 69 forks source link

trying to program basic registers in Arducam MT9V022; can't get manual #151

Closed coldstart01 closed 3 years ago

coldstart01 commented 3 years ago

When I try use the AEC(auto exposure control) I don't get enough light. Worse yet when I try capturing light with manual no AEC its worse, and stepping through the different exposures does not yield a better result. I used the manual. I basically need manual and auto control. Please check settings below and tell me what I am doing wrong.

` Uint32 AFreg_addr = 0xAF; //xAF->175 Uint32 val_xAF = 0; // 0xAF ->0 or 1 // reg: 0xB = 11 Uint32 Breg_addr = 0xB; // 11; Uint32 val_0x0B = 0x3; //x0B -> stepped through 3,32,64,128 w/ increasing light Uint32 store_val1; Uint32 store_val2;

`

Here is implementation: `//write xAF (175) ArduCam_writeSensorReg(cameraHandle, AFreg_addr,val_xAF); //turn on AEC, shed some light ArduCam_readSensorReg(cameraHandle, AFreg_addr, &store_val1); std::cout << "Auto Exp Control reg address ->" << AFreg_addr << "|value stored there -> : "<< store_val1<< std::endl;

            //write 0xB (11)
            ArduCam_writeSensorReg(cameraHandle, Breg_addr, val_0x0B); // write value (val_0x0B) to register 11
            ArduCam_readSensorReg(cameraHandle,  Breg_addr, &store_val2 );
            std::cout << "Auto Exp Control reg address ->" << Breg_addr<< "|value stored there ->  : " << store_val2 << std::endl;

`

coldstart01 commented 3 years ago

Let me restate, and simply: ' R0xAF[0] = 0 ` How do I write the above register change in c++?