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)
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 ?
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.