Hallo everyone,
i just got my Ethernetshield and i`m trying to store some Data in an MicroSD card and read it back.
My Writing function is:
createFile("VERSION.NUM", "Versionsnummer")
void createFile(char* dateiname , String dateiinhalt) {
int bytewritten = 0;
// Erstellt eine Datei mit dem übergebenem Inhalt
myFile = SD.open(dateiname , FILE_WRITE);
bytewritten = myFile.print(dateiinhalt);
myFile.close();
}
The file is created on the card. now i try to read the just written data back
readfromFile("VERSION.NUM");
void readfromFile(char* dateiname) {
String incommingData = "";
myFile = SD.open(dateiname , FILE_READ);
while (myFile.available()) {
Serial.println(myFile.read());
}
myFile.close();
}
In the Serial Monotor i get:
86
101
114
115
105
111
110
115
110
117
109
109
101
114
I guess these are the bytes wich were read, but how do i get a "humanreadable" String of this to use the stored data in the programm?
CL