@@ -56,9 +56,9 @@ void printFolderContents(Folder dir, int indentation = 0) {
56
56
57
57
58
58
// Uncomment one of the three lines below to select between SD card, USB or internal storage
59
- // SDStorage sdStorage = SDStorage() ; // Create an instance for interacting with SD card storage
60
- // USBStorage usbStorage = USBStorage() // Create an instance for interacting with USB storage
61
- InternalStorage internalStorage ;
59
+ // SDStorage storage ; // Create an instance for interacting with SD card storage
60
+ // USBStorage storage; // Create an instance for interacting with USB storage
61
+ InternalStorage storage ;
62
62
63
63
64
64
void setup () {
@@ -69,14 +69,16 @@ void setup() {
69
69
Arduino_UnifiedStorage::debuggingModeEnabled = false ;
70
70
71
71
72
- internalStorage = InternalStorage ();
72
+ storage = InternalStorage ();
73
+ // storage = SDStorage(); // Uncomment this line to use SD card storage
74
+ // storage = USBStorage(); // Uncomment this line to use USB storage
73
75
74
- if (!internalStorage .begin ()){
76
+ if (!storage .begin ()){
75
77
Serial.println (" Error mounting storage device." );
76
78
}
77
79
78
80
// Create a root directory in storage device
79
- Folder root = internalStorage .getRootFolder ();
81
+ Folder root = storage .getRootFolder ();
80
82
81
83
// Create subdirectories inside the root directory
82
84
Folder subdir1 = root.createSubfolder (" subdir1" );
@@ -126,7 +128,7 @@ void setup() {
126
128
}
127
129
Serial.println ();
128
130
129
- printFolderContents (internalStorage .getRootFolder ());
131
+ printFolderContents (storage .getRootFolder ());
130
132
}
131
133
132
134
void loop () {
0 commit comments