/Modules/Sensors/ALTIMET01A/SW/Python/data_logger.py
0,0 → 1,62
#!/usr/bin/python
 
# Python driver for MLAB MAG01A module with HMC5888L Magnetometer sensor wrapper class
 
import time
import datetime
import sys
 
from pymlab import config
 
 
#### Script Arguments ###############################################
 
if len(sys.argv) != 3:
sys.stderr.write("Invalid number of arguments.\n")
sys.stderr.write("Usage: %s PORT ADDRESS\n" % (sys.argv[0], ))
sys.exit(1)
 
port = eval(sys.argv[1])
address = eval(sys.argv[2])
 
 
#### Sensor Configuration ###########################################
 
cfg = config.Config(
port = 1,
bus = [
{
"type": "i2chub",
"address": 0x70,
"children": [
{
"type": "i2chub",
"address": 0x70,
"channel": 1,
},
],
},
],
)
cfg.initialize()
 
gauge = cfg.get_device("altimet")
 
 
#### Data Logging ###################################################
 
try:
with open("temperature.log", "a") as f:
while True:
(t, p) = gauge.get_tp()
#sys.stdout.write(" Temperature: " + str(t) + " Preassure: " + str(p) + "\r\n")
sys.stdout.write(" Temperature: %.2f Pressure: %d\n" % (t, p, ))
f.write("%d\t%s\t%.2f\t%d\n" % (time.time(), datetime.datetime.now().isoformat(), t, p, ))
sys.stdout.flush()
time.sleep(0.5)
except KeyboardInterrupt:
sys.exit(0)
 
/Modules/Sensors/SHT25V01A/test/heating_control/Heating_alter.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Modules/Sensors/SHT25V01A/test/heating_control/Heating_alter2.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Modules/Sensors/SHT25V01A/test/heating_control/plot.gp
14,3 → 14,7
set output "Heating_alter2.png"
plot "test_hum2.log" using 0:1 with lines title "Temperature", "" using 0:2 with lines title "Humidity", "" using 0:4 with lines title "Heating"
 
 
set output "outdoor_test.png"
plot "TempHum.log" using 1:3 with lines title "Temperature", "" using 1:4 with lines title "Humidity"