Line 34... |
Line 34... |
34 |
"channel": 0, |
34 |
"channel": 0, |
35 |
"children": [ |
35 |
"children": [ |
36 |
{"name": "barometer", "type": "altimet01" , "channel": 0, }, |
36 |
{"name": "barometer", "type": "altimet01" , "channel": 0, }, |
37 |
{"name": "hum_temp", "type": "sht25" , "channel": 1, }, |
37 |
{"name": "hum_temp", "type": "sht25" , "channel": 1, }, |
38 |
# {"name": "wind_direction", "type": "mag01" , "channel": 1, }, |
38 |
# {"name": "wind_direction", "type": "mag01" , "channel": 1, }, |
39 |
{"name": "thermometer", "type": "lts01" , "channel": 2, }, |
39 |
# {"name": "thermometer", "type": "lts01" , "channel": 2, }, |
40 |
], |
40 |
], |
41 |
}, |
41 |
}, |
42 |
# {"name": "barometer2", "type": "altimet01" , "channel": 6, }, |
42 |
# {"name": "barometer2", "type": "altimet01" , "channel": 6, }, |
43 |
], |
43 |
], |
44 |
}, |
44 |
}, |
Line 48... |
Line 48... |
48 |
cfg.initialize() |
48 |
cfg.initialize() |
49 |
|
49 |
|
50 |
barometer = cfg.get_device("barometer") |
50 |
barometer = cfg.get_device("barometer") |
51 |
hum_temp = cfg.get_device("hum_temp") |
51 |
hum_temp = cfg.get_device("hum_temp") |
52 |
#wind_direction = cfg.get_device("wind_direction") |
52 |
#wind_direction = cfg.get_device("wind_direction") |
53 |
thermometer = cfg.get_device("thermometer") |
53 |
#thermometer = cfg.get_device("thermometer") |
54 |
time.sleep(0.5) |
54 |
time.sleep(0.5) |
55 |
|
55 |
|
56 |
#### Data Logging ################################################### |
56 |
#### Data Logging ################################################### |
57 |
|
57 |
|
58 |
filename = datetime.datetime.now().isoformat() |
58 |
filename = datetime.datetime.now().isoformat() |
Line 63... |
Line 63... |
63 |
while True: |
63 |
while True: |
64 |
barometer.route() |
64 |
barometer.route() |
65 |
(t1, p1) = barometer.get_tp() |
65 |
(t1, p1) = barometer.get_tp() |
66 |
hum_temp.route() |
66 |
hum_temp.route() |
67 |
t2 = hum_temp.get_temp() |
67 |
t2 = hum_temp.get_temp() |
68 |
t3 = thermometer.get_temp() |
68 |
# t3 = thermometer.get_temp() |
- |
|
69 |
t3 = -200 |
69 |
h1 = hum_temp.get_hum() |
70 |
h1 = hum_temp.get_hum() |
70 |
|
71 |
|
71 |
|
72 |
|
72 |
sys.stdout.write(" Temperature: %.2f Pressure: %d TempSHT: %.2f HumSHT: %.1f TempLTS: %.2f" % (t1, p1, t2, h1, t3)) |
73 |
sys.stdout.write(" Temperature: %.2f Pressure: %d TempSHT: %.2f HumSHT: %.1f TempLTS: %.2f" % (t1, p1, t2, h1, t3)) |
73 |
f.write("%d\t%.2f\t%d\t%.2f\t%.1f\t%.2f\n" % (time.time(),t1, p1, t2, h1, t3)) |
74 |
f.write("%d\t%.2f\t%d\t%.2f\t%.1f\t%.2f\n" % (time.time(),t1, p1, t2, h1, t3)) |