I have a project that requires a large amount of data. I want to create a new file each day using the parsed GPS date.
the following is a snippet of my code.
when I print using Serial.println(fileName); I get 20_1_13.csv
but I get an error using the above code.
datacollector.ino: In function 'void loop()':
datacollector:185: error: no matching function for call to 'SDClass::open(String&, int)'
C:\Users\Herb\Desktop\arduino-1.0.3\libraries\SD/SD.h:74: note: candidates are: File SDClass::open(const char*, uint8_t)
Or, if you insist on shooting yourself in the foot anyway, read the error message. It's telling you that the open() method does not have an overload that takes a String. It has one that takes a const char *. So, look at the documentation for the String class and see how you can get a const (or not) char * from the String instance.
I was just running into this problem too. I got that it was the string that was throwing it all off, but without your help, I wouldn't have known about sprintf(). Thanks! I'm gonna look that one up right now as well as the const char one for string.