I'm currently integrating a SD-Card-module into my project and I am struggeling to automatically create new filenames correctly.
I have a series of char data i would like to combine to a filename.
The above code does not work, it breaks into the else loop: "error opening file".
It does not matter wether I use the NULL-Marker at the end or not.
It works however if I hard-code the filename entirely like so:
myFile = SD.open("abcdefg.txt", FILE_WRITE);
I feel like i lack some detail about usage of char arrays but most articles in the web do not really help me.
Do you have any idea how to create such a filename properly?
Thanks and best regards!
Thanks for the quick answers.
Problem is that I cannot hardcode it like that:
char sFilename[]="abcdefg.txt";
I recieve the single letters for the name as single chars as a code for the current time.
All I want to do is somehow combine them to look like a "normal" String (or string or whatever the compiler automaticcally thinks a value like "abcdefg.txt" is)
Best regards
I recieve the single letters for the name as single chars as a code for the current time.
Then there are several different ways to turn them into a filename, but however you do it then it is essential to declare the array large enough to hold the resultant string