Browse Source

Added user specific humidity/light calculation factor constants.

klaute 1 year ago
parent
commit
b4284ccb3c
2 changed files with 7 additions and 3 deletions
  1. 3
    0
      firmware/config_user.h.example
  2. 4
    3
      firmware/sensors.ino

+ 3
- 0
firmware/config_user.h.example View File

@@ -11,6 +11,9 @@
11 11
 //#define WEBUPDATER_FEATURE
12 12
 #define BATTERY_POWERED
13 13
 
14
+const float HUMIDITY_FACTOR = 1.0
15
+const float LIGHT_FACTOR    = 1.0
16
+
14 17
 // InfluxDB credentials
15 18
 const char     *INFLUXDB_HOST = "hostname";
16 19
 const uint16_t  INFLUXDB_PORT = 80;

+ 4
- 3
firmware/sensors.ino View File

@@ -14,7 +14,7 @@ float fetchPressure() {
14 14
 }
15 15
 
16 16
 float fetchHumidity() {
17
-  return bme.readHumidity();
17
+  return bme.readHumidity() * HUMIDITY_FACTOR;
18 18
 }
19 19
 
20 20
 float fetchLight() {
@@ -28,7 +28,7 @@ float fetchLight() {
28 28
   apds.getColorData(&red, &green, &blue, &white);
29 29
   //calculate lux
30 30
   lux = apds.calculateLux(red, green, blue);
31
-  return lux;
31
+  return lux * LIGHT_FACTOR;
32 32
 }
33 33
 
34 34
 void _anemometerInterrupt() {
@@ -74,4 +74,5 @@ float isBatCharging() {
74 74
   return BAT_CHARGE_STATE_NOTCHARGING;
75 75
 }
76 76
 
77
-#endif
77
+#endif
78
+

Loading…
Cancel
Save