Please bear with me, I'm pretty new to Arduino, and my coding skills only go as far as Matlab, but...
Im trying to write some code that will dynamically change the name of a text file that is then going to save to an HD card. So far I have something like:
int trial = 1; String name = "Evt"; String name2 = name += trial; name2.concat(".txt"); char filename[ name2.length() +1 ]; name2.toCharArray( filename, name2.length() ); File dataFile = SD.open(filename, FILE_WRITE);
And eventually trial will count up.
So no matter what I do, I always get files saved that look like EVT1.TX, EVT2.TX, etc etc. The last T never saves. This happens when I use
char filename[ name2.length() ]; char filename[ name2.length() +1 ]; char filename //should be this for EVT1.TXT char filename
Nothing I seem to do changes it, even when I allocate enough space. Any thoughts?