mirror of
https://github.com/0015/ThatProject.git
synced 2026-01-12 09:17:42 +03:00
First Commit
This commit is contained in:
33
Esp32_jpeg/fileTest/fileTest.ino
Normal file
33
Esp32_jpeg/fileTest/fileTest.ino
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "SPIFFS.h"
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
Serial.println("File Test!");
|
||||
|
||||
if (!SPIFFS.begin()) {
|
||||
Serial.println("SPIFFS initialisation failed!");
|
||||
while (1) yield(); // Stay here twiddling thumbs waiting
|
||||
}
|
||||
Serial.println("\r\nInitialisation done.");
|
||||
Serial.println("\n----DIR: /:");
|
||||
listDir("/");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void loop(void) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void listDir(char * dir){
|
||||
|
||||
File root = SPIFFS.open(dir);
|
||||
File file = root.openNextFile();
|
||||
while(file){
|
||||
|
||||
Serial.print("FILE: ");
|
||||
Serial.println(file.name());
|
||||
file = root.openNextFile();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user