Firstly I would suggest you adjust the output from the Arduino and strip it down to minimum. You know for example that the first value it spits out is 'H', the second value is 'W', the third value is 'T'. Comma separate it so it outputs like this when printed from the Arduino:
54.90,0.0,25.70
54.90,0.0,25.70
54.90,0.0,25.70
Then you can easily parse the serial data into an array by reading the line into a variable, splitting it by comma (assume what follows is pseudocode so your mileage may vary):
Code: Select all
while True:
while (ser.inWaiting()==0):
pass
serData = ser.readline()
serData = serData .decode("utf-8").rstrip('\n').split(",")
You then know that the data at position 0 in the serData array is H, 1 is W, 2 is T and so on. Should make it easier to export to whatever format or manipulate.
My first foray into programming required I did similar
http://bimbam.ddns.net/sensor-logger-arduino-pi/
Shameless plug I know, but it's all there (including the graph generation using Matplotlib). I'm still fairly new to programming so I doubt this is the most efficient way to do it. For one I dumped to CSV then read BACK from CSV to generate the graphs instead of doing it all in memory. Still need to overhaul that >.<
*EDIT* : I would definitely avoid using my script to work from as a basis of educating yourself. It is almost entirely comment-less making it a headache for me to read it and I wrote it lol. Pro Tip, COMMENT EVERYTHING YOU DO!