ArduCAM / ArduCAM_ESP32S_UNO

ArduCAM ESP32 Series Development Boards
52 stars 19 forks source link

What are is the correct method to make a cameraInit() wakeup function #14

Open martinberlin opened 5 years ago

martinberlin commented 5 years ago

I'm trying to wake up camera only on the moment of taking a picture and then shutting it of via a P-channel mosfet.

So I built this functions:

void cameraInit() {
  digitalWrite(gpioCameraVcc, LOW);       // Power camera ON
  // OV5642 Needs special settings otherwise will not wake up
  myCAM.clear_bit(6, GPIO_PWDN_MASK);  // Disable low power
  delay(3);
  myCAM.set_format(JPEG);
  myCAM.InitCAM();
  delay(50); 
  myCAM.write_reg(3, 2);               // VSYNC is active HIGH
  delay(47);
}

void cameraOff() {
  digitalWrite(gpioCameraVcc, HIGH); // Power camera OFF
}

But I discovered that this times are not working the same with different OV5642 5 megapixels camera. Question is: There is not a more clever way to do this ? Like make a while(check something) that will return true when camera wakes up fully ? Can you please reference me to a code snippet ?