Go Down

Topic: Data Logging (Read 716 times) previous topic - next topic

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

robtillaart

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.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

daz1761

#2
Aug 25, 2013, 03:52 pm Last Edit: Aug 25, 2013, 03:59 pm by daz1761 Reason: 1
Thanks, ah that explains why I had no success!

Bugger, PC software only.  On a mac.
M

robtillaart

You could use the processing language, which is also available for Mac.
Or a language like Python - google "python capture serial " or so.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

daz1761

M

lafontas

Here is some very basic Python code you can build upon.

Code: [Select]

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()

Nick_Pyner


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.

Jack Christensen

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.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Go Up