From b4284ccb3ce41d6cdfd6a19d289aa1e6124978c8 Mon Sep 17 00:00:00 2001 From: klaute Date: Sun, 3 Feb 2019 14:53:08 +0100 Subject: [PATCH] Added user specific humidity/light calculation factor constants. --- firmware/config_user.h.example | 3 +++ firmware/sensors.ino | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/firmware/config_user.h.example b/firmware/config_user.h.example index a4977d4..9195656 100644 --- a/firmware/config_user.h.example +++ b/firmware/config_user.h.example @@ -11,6 +11,9 @@ //#define WEBUPDATER_FEATURE #define BATTERY_POWERED +const float HUMIDITY_FACTOR = 1.0 +const float LIGHT_FACTOR = 1.0 + // InfluxDB credentials const char *INFLUXDB_HOST = "hostname"; const uint16_t INFLUXDB_PORT = 80; diff --git a/firmware/sensors.ino b/firmware/sensors.ino index 4fc5c14..9643226 100755 --- a/firmware/sensors.ino +++ b/firmware/sensors.ino @@ -14,7 +14,7 @@ float fetchPressure() { } float fetchHumidity() { - return bme.readHumidity(); + return bme.readHumidity() * HUMIDITY_FACTOR; } float fetchLight() { @@ -28,7 +28,7 @@ float fetchLight() { apds.getColorData(&red, &green, &blue, &white); //calculate lux lux = apds.calculateLux(red, green, blue); - return lux; + return lux * LIGHT_FACTOR; } void _anemometerInterrupt() { @@ -74,4 +74,5 @@ float isBatCharging() { return BAT_CHARGE_STATE_NOTCHARGING; } -#endif +#endif +