/Designs/Measuring_instruments/AWS01B/SW/Python/AWS_read.py
36,6 → 36,7
{"name": "barometer", "type": "altimet01" , "channel": 0, },
{"name": "hum_temp", "type": "sht25" , "channel": 1, },
# {"name": "wind_direction", "type": "mag01" , "channel": 1, },
{"name": "thermometer", "type": "lts01" , "channel": 2, },
],
},
# {"name": "barometer2", "type": "altimet01" , "channel": 6, },
49,6 → 50,7
barometer = cfg.get_device("barometer")
hum_temp = cfg.get_device("hum_temp")
#wind_direction = cfg.get_device("wind_direction")
thermometer = cfg.get_device("thermometer")
time.sleep(0.5)
 
#### Data Logging ###################################################
63,10 → 65,12
(t1, p1) = barometer.get_tp()
hum_temp.route()
t2 = hum_temp.get_temp()
t3 = thermometer.get_temp()
h1 = hum_temp.get_hum()
 
sys.stdout.write(" Temperature: %.2f Pressure: %d TempSHT: %.2f HumSHT: %.1f " % (t1, p1, t2, h1,))
f.write("%d\t%.2f\t%d\t%.2f\t%.1f\n" % (time.time(),t1, p1, t2, h1,))
sys.stdout.write(" Temperature: %.2f Pressure: %d TempSHT: %.2f HumSHT: %.1f TempLTS: %.2f" % (t1, p1, t2, h1, t3))
f.write("%d\t%.2f\t%d\t%.2f\t%.1f\t%.2f\n" % (time.time(),t1, p1, t2, h1, t3))
sys.stdout.flush()
time.sleep(10)
except KeyboardInterrupt: