Hi All,
I am using the https://randomnerdtutorials.com/esp32-data-logging-temperature-to-microsd-card/ example and trying to get it to work in Platform IO
I am picking up the Errors below, would anyone know why?
Many Thanks!
src\main.cpp: In function ‘void setup()’:
src\main.cpp:103:73: error: ‘writeFile’ was not declared in this scope
writeFile(SD,”/data.txt”, “Reading ID, Date, Hour, Temperature \r\n”);
^
src\main.cpp:116:15: error: ‘getReadings’ was not declared in this scope
getReadings();
^
src\main.cpp:117:16: error: ‘getTimeStamp’ was not declared in this scope
getTimeStamp();
^
src\main.cpp:118:13: error: ‘logSDCard’ was not declared in this scope
logSDCard();
^
src\main.cpp: In function ‘void logSDCard()’:
src\main.cpp:163:50: error: ‘appendFile’ was not declared in this scope
appendFile(SD, “/data.txt”, dataMessage.c_str());
^
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
=============================== [FAILED] Took 6.40 seconds ===============================
Hi.
In VS Code, you should declare a function before calling it.
So, move the getReadings(), getTimeStamp() and logSDCard() function declarations to a place before the setup().
Let me know if this solves your issue.
Regards,
Sara
Thanks for the reply Sara,
I also had to move void appendFile() before LogSDCard() and all is working now, thanks for the help!