I want to transfer igc formatted gps data from sd card to array. After a little search,I managed to read some integer variables from sd card and stored into a buffer.But my file consist of long strings like this:
B0910143840080N03532760EA0168801753
B0910153840080N03532760EA0168801753
B0910163840080N03532761EA0168901754
B0910173840080N03532761EA0168901754
B0910183840080N03532761EA0168901754
I want to store these strings into an array.Is there any method to do this?
Here is my code:
#include <SPI.h>
#include <SD.h>
File myFile;
int k=0;
unsigned int Buffer[227];
void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");
if (!SD.begin(53)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
myFile = SD.open("1k.txt");
if (myFile) {
Serial.println("Parsed Values:");
while (myFile.available()) {
int val = myFile.parseInt();
Serial.println(val);
Buffer[k]={val};
k++;
}
myFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error opening 1k.txt");
}
for(int i=0;i<k;i++){
Serial.println("Buffer Values:");
Serial.println(Buffer*);*
-
}*
-
}*
-
void loop()*
-
{*
-
}*