2012-10-02 15:46:12 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2012-10-25 15:07:09 +00:00
|
|
|
import serial, struct
|
|
|
|
|
|
|
|
try:
|
|
|
|
ser = serial.Serial('/dev/ttyUSB0', 9600)
|
|
|
|
i = ser.read(30)
|
|
|
|
data = list(struct.unpack("hhhhhhhhhhhhhhh", i))
|
|
|
|
print "ts_min", data[0]
|
|
|
|
print "ts_max", data[1]
|
|
|
|
print "tl", data[2]
|
|
|
|
print "tp", data[3]
|
|
|
|
print "time_max", data[4]
|
|
|
|
print "ramp_up_min", data[5]
|
|
|
|
print "ramp_up_max", data[6]
|
|
|
|
print "ramp_down_min", data[7]
|
|
|
|
print "ramp_down_max", data[8]
|
|
|
|
|
|
|
|
print "ts_duration_min", data[9]
|
|
|
|
print "ts_duration_max", data[10]
|
|
|
|
print "tl_duration_min", data[11]
|
|
|
|
print "tl_duration_max", data[12]
|
|
|
|
print "tp_duration_min", data[13]
|
|
|
|
print "tp_duration_max", data[14]
|
|
|
|
|
|
|
|
#while 1:
|
|
|
|
#print ser.read(5)
|
|
|
|
except Exception, e:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|