Pages: 1 [2]   Go Down
Author Topic: Read filename from SD card, store to a string  (Read 2893 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 650
Posts: 50833
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Where is this from?
Left field. I thought you were trying to read the name FROM a file, not the name OF a file.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Crap ok, found it.

I was using these:

//Add the SdFat Libraries
#include <SdFat.h>
#include <SdFatUtil.h>

not the base SD library.

I see available() now too.

Thanks

If you'd posted your actual code (in its entirety), we'd have known that.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

NZ
Offline Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did say in post #1 I am using the SDFAT library, not the SD library. Also posted pieces of the SDFAT functions. I didnt even know there was a SD library 'wrapper' or whatever its called to be honest.

Tried implmenting the SD library instead, but its not compiling. Looks like the 2012 SDFAT library I am using is not quite the same as the 2009 SDFAT library which is part of the SD library included with Arduino 1.01

No luck so far, will keep trying.
« Last Edit: November 06, 2012, 05:26:09 pm by WanaGo » Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's easy to find excuses not to, or reasons why we should have guessed or noticed some quirk of your solution, but there's simply no substitute for posting your actual code when you need help with a coding problem.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm a real noob, so don't jump on me as I haven't written any code.
I'm looking for a sample of code to do exactly what the OP was trying to do but I stumble into too many issues over creating a dynamic string array and reading each file name. There are too many libraries and I'm not a programmer. I'd appreciate some help.
I need a simple sketch that creates a character array, opens the root directory, reads the names and appends them to the array to allow it to be read and accessed later. This will be used to play .wav files from the card. I have code to read a named .wav file and play it from the SD card but this string manipulation part of the project eludes me.
I have looked at the CardInfo example but can't understand how to move the read list to a script. I've tried to modify the openNextFile example on the arduino reference site, but can't go from printing the file names to adding them to a script. I'm sure that this is simple but it's beyond me.
I know I'm asking for someone to post a short sketch for me, I do hope people don't find this offensive, but I am lost.

Thanks in advance

Shane
Logged

Pages: 1 [2]   Go Up
Jump to: