add comments

This commit is contained in:
Philipp Kramer 2022-05-19 10:05:26 +02:00
parent 2cf4c5283d
commit 39987eb912

View file

@ -11,8 +11,8 @@ client = udp_client.SimpleUDPClient(args.ip, args.port)
ser = Serial('COM4', 9600, timeout=1)
ser.write(b'M 6\n')
ser.write(b'K 1\n')
ser.write(b'M 6\n') # set output data mode
ser.write(b'K 1\n') # set cozir into streaming mode
while True:
@ -26,7 +26,7 @@ while True:
data=datastring.split(' ')
print(data)
client.send_message('cozir/humidity', int(data[2]))
client.send_message('cozir/temperature', int(data[4]))
client.send_message('cozir/humidity', int(data[2])/10.0)
client.send_message('cozir/temperature', (int(data[4])-1000)/10.0)
client.send_message('cozir/co2filtered', int(data[6]))
client.send_message('cozir/co2raw', int(data[8]))