sending file to arduino

Hey,

for my project it´s necessary to send the information from a .txt file to the arduino. The information always consists of position (e.g. A 1) and a number (e.g. 212). The sended file should be saved on the arduino.

How can I do this? Maybe someone has an example.

Afterwards I want to send the information using I2C. The I2C connection is already working and should send to every PIC16 processor its information.
How can I send one or more Information from the file on the arduino with I2C? (An Example would be great)

Rexy

What is sending the file? How is it connected?
How big is the file? What do you want it saved to? SD card, RAM, EEPROM...

I enjoy your intention to learn a lot and do the work yourself, so I am happy to give you a few examples to start with:

The sended file should be saved on the arduino.

Example DataLogger from the SD library.

How can I send one or more Information from the file on the arduino with I2C? (An Example would be great)

Example "master_writer" from the Wire library.

Ok some more information.
The sending file is a .txt file consiting of 100 x number of position and value .(x position, ypostion, value) e.g.( 1,1 ,210).
The file will be sended with USB cable from the pc to the arduino. The file will be less than 100KB.
I want to save the content of the file on the arduino uno board memory.

Rexy:
The file will be sended with USB cable from the pc to the arduino. The file will be less than 100KB.

So you will need to designate a protocol to send the data. Is it doing to be sent only once? Will it constantly be updated?

I want to save the content of the file on the arduino uno board memory.

Arduino Uno has only 2KB of RAM. It has an additional 1KB of EEPROM, so unless the file is quite a bit under that, you're not going to be able to store it on the Arduino without additional hardware.

For 100 entries of 3 numbers each, assuming they fit in an int, that's 600 bytes. So unless you have other large demands on RAM, it should be possible to hold it.

wildbill:
For 100 entries of 3 numbers each, assuming they fit in an int, that's 600 bytes. So unless you have other large demands on RAM, it should be possible to hold it.

So long as the data is parsed and stored as bytes/ints, rather than actually saved to the Arduino's RAM as is (in ASCII format), then it should fit, depending on the rest of the code.

Of course you could always send it through the USB serial com port. Try hyperterminal or something similar. Only downside is it might require manual entry, but you could always write a computer program to get around that.

more details:
as you write the idea of using int seems for me the best way. Then I can send all the information (600byte). The program can do its job and afterwards I ll send the next file. The program itself will have a small demands on RAM.
Ok thanks for that.

And now I need to know how I can do that? Can anyone give me an example to get the .txt file on my arduino board. Ok, I could write all the values in the program, but than at the next time I have to do it again. Is there another way to transfer ?

Gobetwino might help - Gadgets og teknologi | Dansk Tech Blog - Mikmo

Does maybe something exist like, in the simular program "PROCESSING" that loads a txt. file?
Example from Processing:

PImage img;
img = loadImage("x.jpg");

If you have an SD card attached to the Arduino, then there are libraries that will let you read the data from a file. Otherwise, use Gobetwino to pass the data from the file to the Arduino, or write a program yourself, to do the same thing.

So, I have got a satisfying solution.
The code of the .txt will be copied and paste in a int array.
like this:

int x [] = {6,44,96,155,199,254,200,14, .... };

later in the code i ll use the single information like this

int x [5];

Afterwards the program is running I ll do the same procedure again. If the space isn t enough, I ll try the SD card.

Thanks everyone