I'm trying to find a way of having a "database" like structure to read data from. At the moment I'm hard coding the data in the program and later I'll have it on an SD card.
The data is formatted as follows:
Name of point Eg: Witfontein Road
Latitude Eg: -33.951918
Longitude Eg: 22.426744
Direction of travel Eg 50
I've tried an array, but battling to get mixed data into the program. I've used the following formats:
Any idea what is the proper way of having data in an Arduino program? I'll eventually have multiple points which I need to cycle through and see what is the closest one.
incompatible types in assignment of 'const char [9]' to 'char [25]'
String names are not all going to be the same size. Do I need to make them all the same length? When I do make them the same length I get the following error for the same line:
Then have a char * instead of an array and dynamically alllocate the memory needed by a particular c-string if they are entered dynamically. always check that malloc() returned a pointer that is not NULL though
If the database is all static, then just build the pointers at structure declaration and initialisation time (with const char * as a type)
J-M-L, thank you. I've tried char* but still get an error. Without a working example, I don't quite understand your answer and are not any wiser...
Johnny010, yes a CSV file would be perfect. I'm used to working with CSV files, but haven't used it in Arduino coding yet. I've tried to find working examples via Google, but...