-
Gera posted an update 5 years, 4 months ago
@srgdamiano Hello Mrs. Sara, I hope everything is well on your behalf,
So at the moment I am trying to store data in a SD card, the SD card I am using is the one that came with the mayfly kit and I was trying to test out the simple file example code that the Envirodiy website has. When I try to compile it, it says that the next three things were not declared in this scope: setupLogFile(), createDataRecord(), and logData(). I understand the meaning of “were not declared in this scope” but what I am confused with is why is that kind of error happening. I am using Atom with platformIO to test the program and have the SD library installed. They really need to be declared somehow? I think there may be one library that I am missing but I am not sure which one is exactly. I tried SdFat library as well and still the same problem shows up. I am going to try to use this to record data on the Temperature/Humidity sensor I have but I need to figure out this problem first. I hope to hear from you soon!
In the future, please create a forum post instead of a status update.
To use PlatformIO, the code has to be structured like proper C++. That is, move the definition of those three functions to above the loop and setup functions. They must be at least declared above the setup and loop. If you’re using the Arduino IDE, which that sketch was originally written for, it has some fuzziness that lets you write improperly structured code. PlatformIO is by far a better IDE, but it requires proper code.