Go Down

Topic: Can Arduino write to a text file? (Read 28 times) previous topic - next topic

Intenzity

@mattkime - I know this is from over a year ago but here is the syntax:


DesktopG4:~ Intenzity$ cat /dev/cu.usbserial-A800etC0 9600 >> MyTextLog.txt

You might be missing the port speed of 9600 (match whatever the port speed is you have set in the sketch of course).

To see the exact name of your ports type: ls /dev/

Then copy/paste if you want to in order to get the exact name right.

I get a nice text file in my home directory with the output from the serial monitor with the above command.

InvalidApple

Yes: With a microSD sheild from spark fun!

I am saving an XML file for a project using...

http://www.sparkfun.com/commerce/product_info.php?products_id=9802

I chose an XML file, because it is really easy for a .NET program to read.  However, it is possible to write any type of program you like! (*.txt, *.xml, *.c, *.cpp, ...)

The way you create a file is
-> open "file.txt" (or whatever you like)
-> write ....

... and it copies what you have in an array to a file.

You can then open the file on the card and read it back!

And at any time, you can take the microSD card out and put it into your computer (which is what I'm doing) for easy data transfer.

:)

Go Up