Pages: [1]   Go Down
Author Topic: SD card file naming  (Read 2511 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I need some coding help, and would appreciate any suggestions as to the feasibility of this idea and how to accomplish it.

I'm looking to incorporate a SD card to log disolved oxygen readings from an atlas scientific probe and breakout board. I would like to set up the arduino to write to a new file for each reading. I'm looking for a way in which I can have the file be named based on the date/time as well as a user defined 5 digit number. i.e. 2012.10.10.09.30.xxxxx.csv.

I would like the date and time section of the file name to be set automatically, and use a rotary encoder to scroll through 0-9 and use the momentary switch to move to the next number in the user defined section. Once the last number is selected, pressing the momentary switch would begin logging.

As far as the SD card, I was looking at using the Parallex SD card adapter sold by Jameco (2082935), but am open to other options. Any guidance would be greatly appreciated.

Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think any of the Arduino SD libraries support filenames that are not in 8.3 format.
Logged

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

ok, so I'm limited to 8. I suppose if the file has a date created stamp, it would have a time as well, and I could name the file simply the user defined number.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Someone else will have to confirm, but I don't think files are date/time stamped either. Generally, the Arduino doesn't have date/time information.
Logged

Leeds, England
Offline Offline
Sr. Member
****
Karma: 8
Posts: 450
Quick, chuck it in the bin before the boss finds out...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a function for time stamping the files - try a search for it. I've had a play with it an it seems to work. If you can't find it I think I have a copy saved at home.

I have a directory named with the date (20121011) and put my files, named with the time (132310.txt), in there.
Logged

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 553
Posts: 46299
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I would like to set up the arduino to write to a new file for each reading.
Why? A new file per day I'd understand. One file for all readings, time stamped, I'd understand.

One file, one reading, I don't.
Logged

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

PaulS,

I would like one file, one reading and the date and time stamp to correlate DO to brix in a fermenting barrel of wine. The user defined number will be the 5 digit barrel number. We're looking to see with a few hits of oxygen from a stone at different intervals affects the rate of fermentation and temperature. I'm looking for an easy way to differentiate the different times we hit each barrel with O2. Since I can't use more than 8 characters for the file name, I'm thinking of adding a letter to the end of the number sequence to denote the time sequence. This however, runs into the problem that I would need to write out the letter to keep track of which is next in the sequence. If I'm doing that, I might as well write down the time and date as well on a paper list & rename the files to the format I originally suggested once on the computer. That is just more work, and I think there could be a more elegant solution that isn't causing me to spend a bunch of time cross referencing that paper list.
« Last Edit: October 11, 2012, 07:23:32 pm by aurelius » Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are using sdfatlib, rather than the cut down version (SD.h) supplied with the IDE, you can update the timestamp on files, but you will need to maintain the time within your sketch, either with an RTC, or using the software-only Time library functions.

http://code.google.com/p/sdfatlib/
Logged

Pages: [1]   Go Up
Jump to: