I’m trying to figure out IF its possible to create and write a .csv file directly to my computers hard drive rather than the SD card? I’ve tried various variations of the SD libraries code and even created a blank .csv file within my home directory, but no success so far.
The Arduino cannot access a PC's harddrive, you need some application watching the serial line.
Google for - GOBETWINO - might be part of the trick.
Thanks, ah that explains why I had no success!
Bugger, PC software only. On a mac.
You could use the processing language, which is also available for Mac. Or a language like Python - google "python capture serial " or so.
Will do thanks
Here is some very basic Python code you can build upon.
import serial import time ser = serial.Serial('com5', 9600, timeout=1) time.sleep(1) logfile = open('C:\Documents and Settings\User\Documents\datalog.csv', 'a') while 1: line = ser.readline() now = time.strftime("%d/%m/%Y %H:%M:%S", time.localtime()) a = "%s, %s, %s" % (now, line, "\n") print a logfile.write(a) logfile.flush() logfile.close() ser.close()
daz1761: I'm trying to figure out IF its possible to create and write a .csv file directly to my computers hard drive rather than the SD card?
There several terminal programmes that can read Arduino and write to csv. I use RealTerm but I don't think there is anything special about it. PLX DAQ is an Excel macro that reads Arduino direct to Excel and gives real-time graphs as well. All the above replace the serial monitor with no change to software.
I have a logger that outputs the data directly as a CSV file, so all that is needed is a USB to serial interface (FTDI, etc.) and a terminal program to capture the output.