Go Down

Topic: Sequential file naming on SD card (Read 622 times) previous topic - next topic

samarkh

I'm struggling here a bit.
I want to write a fresh file each time the SD card is inserted.
e.g.
data0.csv
data1.csv
data2.csv

so I thought that something like
count++
fileName="data" & count & ".csv"
could work.
but this approach looks to be rubbish.
What is the correct approach?
Yours Simon M.

PaulS

Quote
so I thought that something like
count++
fileName="data" & count & ".csv"
could work.
but this approach looks to be rubbish.
What is the correct approach?

The correct approach is to use code that stands a chance of working. No matter what type fileName is, the & operator is not the correct one to use.

Of course, you should be able to see from this comment that we don't know what type fileName is, so any help in getting a variable encoded in the variable is going to be vague.

If you'd read the sticky, you'd know that the requirement for posting here is to post your code (properly).

el_supremo


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy