I am building a simulator for a project for which I would like to call GPS data from an external source. I haven't decided where this source is going to be held, Sd card etc, but for now that part is irrelevament as I can refer to a .h file I presume.
The data currently is in csv format and comprises of 3 collumns, such as....
long, lat, altitude
-0.717625,54.435313,200
-0.717445,54.435280,201
-0.717131,54.435217,201
-0.716908,54.435156,202
-0.716506,54.435117,202
-0.716105,54.435051,201
-0.715928,54.435019,201
-0.715752,54.434960,202
-0.715531,54.434900,202
-0.715357,54.434815,203
-0.715183,54.434731,201
-0.715009,54.434673,202
The piece of code which is of interest is...
void loop()
{
for (int i = 0; i < count; ++i)
{
int result = 0;
track_sim_reg track_reg = {0};
track_reg.longitude = (int32_t) (DEG_TO_RAD(-0.717625f) * 10000000.0f);
track_reg.latitude = (int32_t) (DEG_TO_RAD(54.435313f) * 10000000.0f);
track_reg.altitude = 200;
delay(10);
}
delay(100);
}
Where the actual figures are currently represented for lat, long and altitude in the loop function, how would I call the next consecutive line from the .csv to populate these fields please.
I can visualise what I need, just not sure what format is best to store the data in (csv, json etc) for it to be called from the loop.
Many thanks and hope that all makes sense !