I'm using the SD.h
library to write onto an SD card with the Arduino Uno. I need to write out in a file a template string with some placeholder replaced by certain values, in the way of printf
behaves. I would use the fprintf
function, but when I tried this:
File dataFile = SD.open("myfile.txt", FILE_WRITE);
fprintf(dataFile, "mynumber: %d\n", 100);
I got this error:
cannot convert 'File*' to '__file*' for argument '1' to 'int fprintf(__file*, const char*, ...)'
How can I manage this?