ignore empty inputs from serial (idk why this happens)
This commit is contained in:
parent
54509b0c12
commit
ea55ec786f
1 changed files with 5 additions and 3 deletions
|
@ -16,7 +16,9 @@ outfile = "epever-tracer.json"
|
||||||
while 1:
|
while 1:
|
||||||
# ser.readline()
|
# ser.readline()
|
||||||
Data = ser.readline().decode('ascii')
|
Data = ser.readline().decode('ascii')
|
||||||
|
print("Data: ")
|
||||||
print(Data)
|
print(Data)
|
||||||
|
if len(Data) > 0:
|
||||||
outFile = open(outfile, "w")
|
outFile = open(outfile, "w")
|
||||||
outFile.write(Data)
|
outFile.write(Data)
|
||||||
outFile.close
|
outFile.close
|
||||||
|
|
Loading…
Reference in a new issue