#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
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
I uploaded it using the Arduino IDE, and the sketch behaves just fine. Clearly this is a PlatformIO/VSCode issue for me…
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 😉
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?
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
void takeSavePhoto(String path) above the loop().
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.