Hi! I have a file on my pc and I need to transfer it to the sd that is in arduino, how can I do this? What I need more specifically is to point the path of dir_copy = "/ farth_fs"; to sd which is in arduino. Where / farth would be my path to SD This way every time I make any changes to this file it will be saved back to SD. thank you.
Why not just stick the SD Card into the PC and copy the file there?
If you really want to send data to an Arduino for the Arduino to store on an SD Card then you will need a suitable program on the PC to read the data from the file on the PC and send it in small chunks to the Arduino. And you will need an Arduino program that can receive each chunk, save it to the SD Card and then ask for the next chunk.
For receiving the data on the Arduino have a look at the examples in Serial Input Basics - simple reliable ways to receive data.
The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.
You can send data in a compatible format with code like this (or the equivalent in any other programming language)
Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker
If you need to write a PC program then this Simple Python - Arduino demo may help get you started.
...R
profmarciolucio:
Hi! I have a file on my pc and I need to transfer it to the sd that is in arduino, how can I do this? What I need more specifically is to point the path of dir_copy = "/ farth_fs"; to sd which is in arduino. Where / farth would be my path to SD This way every time I make any changes to this file it will be saved back to SD. thank you.
Why not use a USB to SD "converter"? I use one myself - no Arduino needed
