Skip to content

Adding OV5640 Auto Focus Support #693

@toddremo

Description

@toddremo

There is a super easy way to add autofocus capability to the OV5640. I'm sure there is a better way, but this method works exceptionally well:

  1. Add the OV5640 Auto Focus For ESP32 Camera Library in Arduino IDE
  2. Add the following to the top of mjeg2sd.cpp:
#include "ESP32_OV5640_AF.h"
#include "esp_camera.h"
OV5640 ov5640 = OV5640();
  1. Add the following after LOG_INF("Camera model %s ready @ %uMHz", camModel, xclkMhz); :
      sensor_t* sensor = esp_camera_sensor_get();
      ov5640.start(sensor);

      if (ov5640.focusInit() == 0) {
        LOG_INF("OV5640_Focus_Init Successful!");
      }
      if (ov5640.autoFocusMode() == 0) {
        LOG_INF("OV5640_Auto_Focus Successful!");
      }

Works like a charm!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions