Having multiple files on an SD card, I can't seem to figure out how to open the correct file. Let's say I have 256 files like this:
ajob1.txt
ajob2.txt
ajob3.txt
...
ajob256.txt
Now the number is the ID I get from somewhere else:
byte ID = x
for (int x = 1; x < 257; x++)
{
}
then my filename is something like ajob ID .txt
but how do I get to replace the ID by the number so I can use this
myFile = SD.open("ajob ID .txt");
if (myFile) {
Serial.println("ajob ID .txt:");
// read from the file until there's nothing else in it:
while (myFile.available()) {
Serial.write(myFile.read());
}
// close the file:
myFile.close();