• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 cam project book Includes help

Q&A Forum › Category: ESP32 › ESP32 cam project book Includes help
0 Vote Up Vote Down
Donald asked 5 years ago

#include “esp_camera.h”
#include “FS.h”                // SD Card ESP32
#include “SD_MMC.h”            // SD Card ESP32
#include “soc/soc.h”           // Disable brownout problems
#include “soc/rtc_cntl_reg.h”  // Disable brownout problems
#include “driver/rtc_io.h”
 
These are the required includes for Module 2, example 1, using a MicroSD card to save a loop of photos on the ESP32 cam. I have no idea how to access these required includes.
 
I’m using VSCode/Platform IO now, and the errors I get are:
 
 
‘configInitCamera’ was not declared in this scope
‘initMicroSDCard’ was not declared in this scope
‘takeSavePhoto’ was not declared in this scope

Question Tags: esp32 camera libraries includes
5 Answers
0 Vote Up Vote Down
Donald answered 5 years ago

I uploaded it using the Arduino IDE, and the sketch behaves just fine. Clearly this is a PlatformIO/VSCode issue for me…

0 Vote Up Vote Down
Steve Mercer answered 5 years ago

In PlatformIO you just need to add the library to the project. Just like you have to do in Arduino IDE. The two good things are PlatformIO will add dependencies and the project becomes self contained.
 
you will love it once you figure it out 😉

0 Vote Up Vote Down
Donald answered 5 years ago

Okay, but how do I install “soc/rtc_cntl_reg.h” or any of those others? I didn’t have to install anything when I used arduino IDE, it found what it needed automatically. 
Also, is there any way to install libraries (or boards for that matter) without having to be working in a project that requires them, like, just install these things knowing that I’ll use them in the future?

0 Vote Up Vote Down
Donald answered 5 years ago

Took some digging, but I figured out what the issue was. Rui’s original code had functions *BELOW* their calls. As the Guy With The Swiss Accent says, “all functions must be moved to a place before they are used.” 
Essentially, I was running into another scope issue.
All the libraries were intact, the problem was placement of the functions in the sketch. Rui wrote and built the code (correctly) for the Arduino IDE. I just had to reposition configInitCamera(),

initMicroSDCard() and

void takeSavePhoto(String path) above the loop().

0 Vote Up Vote Down
Steve Mercer answered 5 years ago

Glad you figured it out. That guy with the Swiss accent knows his stuff.
 
The idea with PlatformIO is you can share a project that works with the specific versions of libraries included. What happens if a library is updated and that makes your project no longer work? If you share with an older library it works forever. With the Arduino IDE you will have to update your code.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.