Skip to content

Instantly share code, notes, and snippets.

@nipunbatra
Created May 17, 2013 14:02
Show Gist options
  • Save nipunbatra/5599217 to your computer and use it in GitHub Desktop.
Save nipunbatra/5599217 to your computer and use it in GitHub Desktop.
#First on Linux shell figure if the USB-serial convertor has been detected.
# Type dmesg|grep tty and you should probably see the convertor and the tty USB port it is allocated. I shall assume you got #/dev/ttyUSB0
import serial,time
serial_port=serial.Serial('/dev/ttyUSB0')
file_pointer=open('data.csv','wb')
while True:
a=s.readline()
f.write(str(time.time.now())+","+a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment