arrays

Hey,

I have a text file with a series of numbers and I would like to load it into an array in arduino, is this possible and if so how would I do this?

That depends on whether you want to do it at compile time, or run time.

I want to do it as soon as I upload the program to the board.

That still doesn't answer whether you want to do it when you compile your program, in which case the data will be fixed, or once it is uploaded and running, when you could, in theory, upload different data sets, one after the other.

First way is simple - imagine your data was in a file called "mydata", and looked like this:

12, 13, 1456, 27, 89

Your code is simply:

const int myData [] = {
#include "mydata"
};

I want the data to be fixed so when I compile it then.

I nearly forgot:

#define N_DATA_POINTS  (sizeof (myData) / sizeof (myData [0])

Ok Thanks a lot i will give it a try