Hello,
Well, I have been doing my homework and now I am even more confused. I am not a programmer. I lack the vocabulary to even find an example I can work with. Here's what I am trying to do:
In short, I am trying to have my Arduino read calibration tables from an SD card, store those tables in PROGMEM, and then perform a sort of linear interoperation to find the calibrated value of a temperature sensor. The idea is to be able to swap out SD cards with different calibration tables on them.
My calibration tables are relatively small (I think) at about 31 elements that are signed 2-bit integers. My numbers are typically in this format: 0.235, 1.399, -4.211, etc. I converted them all to integers by multiplying by 100 so I wouldn't have to deal with floats. After retrieving the number from the calibration array, I multiply by 0.01 to get the number back to where it needs to be as a float. I am not sure if this is a waste of effort or not.
I have been loading it into PROGMEM for what seemed to be the fastest way to access the info at runtime.
My array looks like this now:
PROGMEM prog_int16_t balanceArray[] = { 0, 8, -10, 56, 136, 189, 315, 315, 523, 620, 734, 971, 929, 1076, 1343, 1742, 1676, 2110, 2351, 2618, 2796, 2520, 2583, 2556, 2684, 2869, 2788, 2308, 2511, 2529, 2452 };
I want to store the balanceArray data on an SD card. I have a MicroSD shield attached to my Uno. When the Arduino is powered up, I want to retrieve the calibration table from the SD card, and load it into the PROGMEM array for runtime.
My goal is to be able swap SD cards and dynamically load different calibration tables.
Is this possible?
Thank you so much for your help.
Ryan
Boston, MA