I have a table of arround 4000 values on my PC that i would like to use in my arduino project.
I have the table available before the program starts running, so I guess I'd have to save it into the arduinos exterenal memory and then when thats finished I can start processing them.
However I have no idea of how to get the table from my pc into my arduino.
Are those values in that table always the same ? If so you can write them in the sketch just once.
If you put them in the sketch, you have to use PROGMEM as MarkT wrote.
Is that table generated ? Perhaps you can generate a *.h file and include that in your project, again with using PROGMEM.
Do you want a single sketch in the Arduino and download the values to the Arduino ?
That is possible, but the Arduino Uno does not have enough RAM or internal EEPROM for that.
You can buy an external EEPROM memory, they are very cheap.
But you have to download the data to the Arduino, so you need to make something on the computer that sends it to the serial port and the Arduino has to read the values and write them in the EEPROM.
Even if your 4000 values are floats or long, that still leaves you half of the available flash memory for code.
Can you arrange for the output of the numbers to be a comma-separated list?
If so:
unsigned long myTable [] PROGMEM = {
#include "comma-separated-values-file.h"
};
Thanks AWOL, that helps!
I'll look for a way to get them seperated by comma.
And for those wondering. The values are generated by matlab, so I can't really make the arduino generate them. And I need them as inputs for a control algorithm that runs on the arduino. However the inputs are always those same 4000 values (for now).