add comments
This commit is contained in:
parent
2cf4c5283d
commit
39987eb912
1 changed files with 4 additions and 4 deletions
|
@ -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]))
|
Loading…
Reference in a new issue