BME dynamic pressure height correction
This commit is contained in:
parent
32c99218d6
commit
4ccea1f74f
|
|
@ -59,6 +59,7 @@ ____________________________________________________
|
|||
____________________________________________________
|
||||
## Timeline (Versions):
|
||||
|
||||
- 2024.06.07 Dynamic Height Correction of the BME280 Pressure readings.
|
||||
- 2024.05.21 WEMOS ESP32 Battery Holder + LoRa SX1278 + GPS Module support added.
|
||||
- 2024.05.16 all boards now work with Radiolib (LoRa) library from @jgromes.
|
||||
- 2024.05.13 BME modules will be autodetected (I2C Address and if it is BME280/BMP280/BME680).
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@
|
|||
},
|
||||
"bme": {
|
||||
"active": false,
|
||||
"heightCorrection": 0,
|
||||
"temperatureCorrection": 0.0,
|
||||
"sendTelemetry": false
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
#include <TinyGPS++.h>
|
||||
#include <logger.h>
|
||||
#include "bme_utils.h"
|
||||
#include "configuration.h"
|
||||
#include "display.h"
|
||||
#include <logger.h>
|
||||
|
||||
#define SEALEVELPRESSURE_HPA (1013.25)
|
||||
#define CORRECTION_FACTOR (8.2296) // for meters
|
||||
|
||||
extern Configuration Config;
|
||||
extern logging::Logger logger;
|
||||
extern TinyGPSPlus gps;
|
||||
|
||||
float newHum, newTemp, newPress, newGas;
|
||||
|
||||
|
|
@ -254,7 +256,7 @@ namespace BME_Utils {
|
|||
} else if (wxModuleType == 2) {
|
||||
humStr = "..";
|
||||
}
|
||||
presStr = generatePresString(newPress + (Config.bme.heightCorrection/CORRECTION_FACTOR), type);
|
||||
presStr = generatePresString(newPress + (gps.altitude.meters()/CORRECTION_FACTOR), type);
|
||||
if (type == 1) {
|
||||
if (wxModuleType == 1 || wxModuleType == 3) {
|
||||
wx = tempStr;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
|
|||
winlink.password = data["winlink"]["password"].as<String>();
|
||||
|
||||
bme.active = data["bme"]["active"].as<bool>();
|
||||
bme.heightCorrection = data["bme"]["heightCorrection"].as<int>();
|
||||
bme.temperatureCorrection = data["bme"]["temperatureCorrection"].as<float>();
|
||||
bme.sendTelemetry = data["bme"]["sendTelemetry"].as<bool>();
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ public:
|
|||
class BME {
|
||||
public:
|
||||
bool active;
|
||||
int heightCorrection;
|
||||
float temperatureCorrection;
|
||||
bool sendTelemetry;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue