Added T, RH readout
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
from time import sleep
|
||||
import minimalmodbus
|
||||
import serial
|
||||
|
||||
@@ -14,5 +15,11 @@ instrument.mode = minimalmodbus.MODE_RTU # rtu or ascii mode
|
||||
instrument.clear_buffers_before_each_transaction = True
|
||||
|
||||
# read
|
||||
T = 0
|
||||
RH = T
|
||||
CO2 = instrument.read_register(9, 1, functioncode=4) * 10
|
||||
print(CO2)
|
||||
sleep(0.1)
|
||||
T = instrument.read_register(10, 1, functioncode=4)
|
||||
sleep(0.1)
|
||||
RH = instrument.read_register(11, 1, functioncode=4) * 10
|
||||
print(f'CO2: {CO2} ppm\t\tT: {T} deg C\t\tRH: {RH} %')
|
||||
|
||||
Reference in New Issue
Block a user