TinyWebServer + Data Logger
Closed this issue · 2 comments
kadu commented
Hi, I'm trying to use TinyWebServer to control my board but I also need to log my board events on SD Card, my last function
void loga() {
String dataString = "/*/*/*/***//**/*/*/";
File dataFile = SD.open("datalog2.txt", FILE_WRITE);
if (dataFile) {
dataFile.println(dataString);
dataFile.close();
Serial.println(dataString);
}
else {
Serial.println("error opening datalog2.txt");
}
}
datalog2.txt does not exists in sdcard, SD.open is not able to create the file.
If I run Datalogger example all things run perfectly.
There are some especial way to write files using TinyWebServer ?
ovidiucp commented
Have you properly initialized the SD library, as it is done in the setup()
function of the Datalogger example?
Also, where are you calling loga() from? Can you make sure it's called at
least once?
There is nothing specific in TWS about the SD library. In fact it is used
in few examples. Take a look at the FileUpload example to see how it writes
into a file.
kadu commented
My error is on i2c, thanks for help