Kalibrierung des Luftdrucks.
This commit is contained in:
6
wstat.py
6
wstat.py
@@ -11,6 +11,10 @@ except ImportError: # Wenn smbus2 nicht zu importieren ist, nehmen wir smbus
|
|||||||
import mysql.connector
|
import mysql.connector
|
||||||
|
|
||||||
port = 1
|
port = 1
|
||||||
|
# Der BME280 ist auf Meerehöhe kalibriert, so dass der gelieferte Luftdruck
|
||||||
|
# vom tatsächlichen Druck am Ort abweicht. Dies müssen wir hier ausgleichen.
|
||||||
|
__luftdruck_kalibrierung__ = 296 # Kalibrierung auf ortsbezogenen Luftdruck
|
||||||
|
|
||||||
adresse_bme280 = 0x76
|
adresse_bme280 = 0x76
|
||||||
adresse_lcd1602 = 0x25
|
adresse_lcd1602 = 0x25
|
||||||
|
|
||||||
@@ -40,7 +44,7 @@ while True:
|
|||||||
|
|
||||||
|
|
||||||
temperature = data.temperature
|
temperature = data.temperature
|
||||||
pressure = data.pressure
|
pressure = data.pressure + __luftdruck_kalibrierung__
|
||||||
humidity = data.humidity
|
humidity = data.humidity
|
||||||
info('{:05.2f}°C {:05.2f}hPa {:05.2f}%'.format(temperature, pressure, humidity))
|
info('{:05.2f}°C {:05.2f}hPa {:05.2f}%'.format(temperature, pressure, humidity))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user