SD card file per day

Hello,

SD card logging is no problem.
Howe ever to log data and to close the log file on 23hr59min and 59 sec. and open a new file with day and month stamp
is not found.
I did some with the for i=0; i>24; i++ but this I do not get it to work.
Is there some code which is able to close a file and opens a new file in a new day?

Theo

Is there some code which is able to close a file and opens a new file in a new day?

Yes.

I did some with the for i=0; i>24; i++ but this I do not get it to work.

You did some what?

I'm sure that the code you wrote did something. I can't imagine what that was.
I'm sure that you expected it to do something. I can't imagine what that was.
Without knowing what the code looked like, what it actually did, and what you expected it to do, we can't tell you how to fix it. Except to say that a for loop will never appear in the correct solution.

Have a look on Time and TimeAlarms libraries (ie TimeAlarmExample.pde).
http://arduino.cc/playground/Code/Time
There is everything you might need.
In SdFat/Example/TimeStamp example you may find how to timestamp the file. It works fine..
p.

Hi Pauls,

Indeed the code did something.
Every time it made a new file with count to 99.
I was looking to modify the code into a daylie file but not succeed.

I will try harder to solve my problem. Some where some howe I have the feeling I am nearby a solution.

ilioSS

pito

I already had a look at this. But un fotinutely it didn,t work out for me?
As you say it works fine I will have another look.
Thanks for yourt help.

ilioSS

I have done this continuously for years. My policy is to open, write, and close the file for each record (a line). I make the filename with the date in its name using RTC data. This way I automatically get one file per day. Usually there are 1440 records, 1 per minute. I have done this with Stamp, Picaxe, and Arduino.