I want to make a file on the SD card (Ethernet shield) with a filename that is stored on a txt file on the same SD.
I’ve tried several things but i can’t get it to work;
Read the txt file and put the name in to a int and convert this int to a char with itoa. but then i get a random number instead of a name. Is it even possible to put characters in a int?
Tried to put the output of filename.read() in to the SD.open() like this: datafile= SD.open(filename.read());. but that isn’t possible becouse you cant define a filename from a int.
Does anybody knows how to do this? Or is this not possible?
i am doing this because i am developing a monitoring system witch is applied to more than one Arduino, so i don't have to change the code on every Arduino, but i can change the file on the SD if i want to change the filename of the file that is send to my FTP server.
The format in the .TXT file is just the name of the file i want to create, for example: test.txt
I have tried that but you can't assign a string as a filename, it gives an error that it has to be a character array. Also when i want to put the content from the .txt file in a string with
"
FileName = SD.open("name.txt");
if (FileName) {
while (FileName.available()) {
filename(FileName.read());
}
"
and i read the string out with "Serial.println(filename);" i get a number instead of the name "arduino1" witch is in de .txt file..