@@ -56,9 +56,9 @@ void printFolderContents(Folder dir, int indentation = 0) {
5656
5757
5858// 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 ;
6262
6363
6464void setup () {
@@ -69,14 +69,16 @@ void setup() {
6969 Arduino_UnifiedStorage::debuggingModeEnabled = false ;
7070
7171
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
7375
74- if (!internalStorage .begin ()){
76+ if (!storage .begin ()){
7577 Serial.println (" Error mounting storage device." );
7678 }
7779
7880 // Create a root directory in storage device
79- Folder root = internalStorage .getRootFolder ();
81+ Folder root = storage .getRootFolder ();
8082
8183 // Create subdirectories inside the root directory
8284 Folder subdir1 = root.createSubfolder (" subdir1" );
@@ -126,7 +128,7 @@ void setup() {
126128 }
127129 Serial.println ();
128130
129- printFolderContents (internalStorage .getRootFolder ());
131+ printFolderContents (storage .getRootFolder ());
130132}
131133
132134void loop () {
0 commit comments