• 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

Visual Studio Code Platform issue with example ESP32 project

Q&A Forum › Category: ESP32 › Visual Studio Code Platform issue with example ESP32 project
0 Vote Up Vote Down
Gavin O’Connor asked 4 years ago

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 ===============================

Question Tags: Visual Studio Code
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

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

0 Vote Up Vote Down
Gavin O’Connor answered 4 years ago

Thanks for the reply Sara,
I also had to move void appendFile() before LogSDCard() and all is working now, thanks for the help!
 

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Great!
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 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.