make some small changes
This commit is contained in:
parent
42994a7dd7
commit
41e3b99e05
|
@ -51,7 +51,13 @@ def read():
|
|||
exit(0)
|
||||
else:
|
||||
controller = serial.Serial(port, baudrate=baud)
|
||||
|
||||
|
||||
# open the file and add a line of header to it, then close
|
||||
f = open(file_name, "a", newline="", encoding="utf-8")
|
||||
writer = csv.writer(f)
|
||||
header = ['Time', 'Resistance']
|
||||
writer.writerow(header)
|
||||
f.close()
|
||||
while controller.isOpen():
|
||||
try:
|
||||
read_data = controller.readline().decode("utf-8")
|
||||
|
|
Loading…
Reference in New Issue