Fixed minor test script bugs

This commit is contained in:
dooku
2021-10-24 20:02:32 +02:00
parent bb3b6ada06
commit 22a5f735b3
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from time import sleep
from time import sleep,time
from sys import exit
import minimalmodbus
import serial
@@ -35,5 +35,5 @@ while True:
T_SCD4x_signed_addr = 15
T_SCD4x_signed = instrument.read_register(T_SCD4x_signed_addr, 1, functioncode=4, signed=True)
with open(log_file, 'a+') as f:
f.write(f'{CO2} {T_SHT4x} {RH_SHT4x} {T_SCD4x} {RH_SCD4x} {T_SHT4x_signed} {T_SCD4x_signed}\n')
f.write(f'{int(time())} {CO2} {T_SHT4x} {RH_SHT4x} {T_SCD4x} {RH_SCD4x} {T_SHT4x_signed} {T_SCD4x_signed}\n')
sleep(10)