Go Down

Topic: Reinitializing SD card with root.close() (Read 199 times) previous topic - next topic

arduino-questions

I have read that in order to use SD.begin() you have to edit the SD.h file to include the line:

Code: [Select]
if (root.isOpen()) root.close();

This may be a very basic question but how do you actually include this line of code? I initially tried just typing it before my second SD.begin() call but it didn't work and I also tried pasting in the entire SD.begin() method into my code but there was an error message saying:

Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Uno"

libraries/SD/SD.cpp.o (symbol from plugin): In function `SDLib::callback_pathExists(SdFile&, char const*, bool, void*)':
(.text+0x0): multiple definition of `SDLib::SDClass::begin(unsigned char)'
sketch/RotaryEncoder_SD_RFID_V6.5.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Thanks!!

ieee488

I have read that in order to use SD.begin() you have to edit the SD.h file to include the line:

Code: [Select]
if (root.isOpen()) root.close();


Where did you read this? ? ? ? ?


.

arduino-questions

#2
Jul 09, 2018, 09:28 pm Last Edit: Jul 09, 2018, 09:36 pm by arduino-questions
@ieee488 I read it from a separate reply by fat16lib

https://forum.arduino.cc/index.php?topic=66415.0

I am also open to any other method to reinitialize the SD card after it has been reinserted!

ieee488

@ieee488 I read it from a separate reply by fat16lib

https://forum.arduino.cc/index.php?topic=66415.0

I am also open to any other method to reinitialize the SD card after it has been reinserted!
He did not say to modify the Sd.h file!!!!

Read it again.


.

arduino-questions

Sorry I just used the wrong wording. I am still not sure how to modify the begin() function though.

Go Up