Hi everyone. I've been looking for this answer but I couldn't find it.
In the main file of the sketch (MAIN.INO), I have this:
bool SDIni = false;
void setup()
{
pinMode(53, OUTPUT);
SDIni = SD.begin(53);
if (!SDIni) { Serial.println("SD can't be initialized"); }
else {
gps_log = SD.open(gps_file, FILE_WRITE); // It's declared in file SIM5320E.h
}
}
void loop()
{
...
}
In another separate class file (SIM5320E.CPP) I want to access SDIni variable but I can't. I've got the error:
SIM5320E.cpp:215:3: error: 'SDIni' was not declared in this scope.
SDIni is a global variable, ¿why can't I access to it?
I assure u I've read all about variables and arduino, and I can't find an appropriate answer.
Any help, please.