Newbie here, learning to program from zero.
I chose the Due for the 512 kB of Flash because I have a few hundred kB of LUTs. The LUTs is currently an excel file but I can store it as csv. When I search, I find countless examples of how to read and parse data from an SD card or hard code in the data into your sketch, like this:
const char image[504] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0,
0xf0, 0xf8, 0xfc, 0xfc, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
...
0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0f,
0x0f, 0x07, 0x01, 0x00
};
My Arduino don't have any SD card reader and I don't want to have it either. I rely on the ample Flash memory. It won't be user changeable anyway.
Two questions:
-
How would I go about somehow appending or make the Arduino programming environment (IDE?) read a csv file which I have on my computer in the same folder as the sketch? Manually typing in the values is unthinkable. Parsing the data manually each time I need to tune something during development would be doable but I can't be the first which this issue. There has to be a simpler way.
-
What would be a reasonable way to threat the data once in the Flash? PROGMEM? At runtime I only need to read my LUTs, never write or update.