-
-
Save rorosaurus/4d9453473ddfa2228b4bf7ed557568db to your computer and use it in GitHub Desktop.
test filesystem sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LittleFS.h> | |
#define CONFIG_FILENAME F("/wifi_cred.dat") | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
// LittleFS.format(); | |
LittleFS.begin(); | |
loadConfigData(); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
} | |
void loadConfigData(void) | |
{ | |
File file = LittleFS.open(CONFIG_FILENAME, "r"); | |
Serial.println("LoadWiFiCfgFile "); | |
if (file) | |
{ | |
int line = file.read(); | |
Serial.print((char)line); | |
while (line != -1){ | |
line = file.read(); | |
Serial.print((char)line); | |
} | |
file.close(); | |
Serial.println("\nLOAD OK"); | |
} | |
else | |
{ | |
Serial.println("LOAD failed"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment