#include <DHT.h>
#include "FS.h"
#include "SD.h"
#include "SPI.h"
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
//Serial.println("Hello, ESP32!");
writeFile(SD, "/config.txt", "Test");
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}
void writeFile(fs::FS &fs, const char * path, const char * message) {
Serial.printf("Writing File: %s\n", path);
File file = fs.open(path, FILE_WRITE);
if (!file) {
Serial.println("Open file for writing FAILED");
return;
}
if (file.print(message)) {
Serial.println("File written");
} else {
Serial.println("Write FAILED");
}
file.close();
}