Doma
Doma

Reputation: 1

Arducam Mega stuck at calling begin()

beginner here... I've been trying to make an Arducam Mega 5MP work with an ESP-Wroom32 board for the past 5 hours now, and I just can't figure out what seems to be the problem with the code/hardware. I'm trying to save pictures to an SD card every 5 seconds, but even a simplified code that checks if the camera has initialized succesfully fails to run, as it always stops at a myCAM.begin() method

Wiring: Arducam Pins --- ESP Pins

VCC --- VIN

GND --- GND

SCK --- GPIO 18

MISO --- GPIO 19

MOSI --- GPIO 23

CS --- GPIO 15

#include <SPI.h>
#include <Arducam_Mega.h>

#define CS_PIN 15
#define SCK_PIN 18
#define MOSI_PIN 23
#define MISO_PIN 19

Arducam_Mega myCAM(CS_PIN);

void setup() {
    Serial.begin(115200);
    delay(1000);
    Serial.println("Starting minimal test...");

    SPI.begin(SCK_PIN, MISO_PIN, MOSI_PIN, CS_PIN);
    SPI.setFrequency(4000000);
    Serial.println("SPI initialized.");

    Serial.println("Calling myCAM.begin()...");
    if (myCAM.begin() != CAM_ERR_SUCCESS) {
        Serial.println("Camera initialization failed!");
        while (1);
    }
    Serial.println("Camera initialized successfully!");
}

void loop() {
    
}

This is what the output on the serial monitor always looks like, it doesn't go further:

Starting minimal test...
SPI initialized.
Calling myCAM.begin()...

Here's what the begin() method looks like in the Arducam_Mega.h file:

CamStatus begin(void);

//**********************************************
//!
//! @brief Start a snapshot with specified resolution and pixel format
//!
//! @param mode Resolution of the camera module
//! @param pixel_format Output image pixel format,which supports JPEG, RGB,
//! YUV
//!
//! @return Return operation status
//!
//! @note The mode parameter must be the resolution which the current camera
//! supported
//**********************************************

Respectively, the Arducam_Mega.cpp file:

CamStatus Arducam_Mega::begin(void)
{
    return ::begin(&cameraInfo);
}

Any tips, anything I should try out? Thank you!

Upvotes: 0

Views: 23

Answers (0)

Related Questions