Browse Source

Fixed anemometer read and humidity value.

klaute 1 year ago
parent
commit
7bb62b5e4e
3 changed files with 7 additions and 13 deletions
  1. 0
    2
      firmware/config.h
  2. 5
    6
      firmware/firmware.ino
  3. 2
    5
      firmware/sensors.ino

+ 0
- 2
firmware/config.h View File

@@ -4,8 +4,6 @@
4 4
 #define BATTERY_POWERED 1
5 5
 #define POWERSAVING 1
6 6
 
7
-#define BOARD_03962A
8
-
9 7
 #define SENSOR_TEMPERATURE    0
10 8
 #define SENSOR_HUMIDITY       1
11 9
 #define SENSOR_LIGHT          2

+ 5
- 6
firmware/firmware.ino View File

@@ -195,15 +195,14 @@ void _loop() {
195 195
     currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature();
196 196
     currentSensorData[SENSOR_HUMIDITY]    = fetchHumidity();
197 197
     currentSensorData[SENSOR_LIGHT]       = fetchLight();
198
-
198
+    currentSensorData[SENSOR_PRESSURE]    = fetchPressure();
199
+    currentSensorData[SENSOR_BAT_VOLTAGE] = getBatteryVoltage();
199 200
     // Disable expensive tasks
200 201
     if (energySavingMode() == 0) {
201
-      currentSensorData[SENSOR_WINDSPEED]   = fetchWindspeed();
202
+      currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
202 203
     } else {
203
-      currentSensorData[SENSOR_WINDSPEED]   = -1;
204
+      currentSensorData[SENSOR_WINDSPEED] = -1;
204 205
     }
205
-    currentSensorData[SENSOR_PRESSURE]    = fetchPressure();
206
-    currentSensorData[SENSOR_BAT_VOLTAGE] = getBatteryVoltage();
207 206
 
208 207
 #ifdef DEBUG
209 208
     Serial.println("");
@@ -229,4 +228,4 @@ void _loop() {
229 228
 
230 229
 }
231 230
 
232
-//*************************************************************************//
231
+//*************************************************************************//

+ 2
- 5
firmware/sensors.ino View File

@@ -13,7 +13,7 @@ float fetchPressure() {
13 13
 }
14 14
 
15 15
 float fetchHumidity() {
16
-  return bme.readHumidity();
16
+  return bme.readHumidity() * 2;
17 17
 }
18 18
 
19 19
 float fetchLight() {
@@ -50,10 +50,7 @@ float fetchWindspeed() {
50 50
 float getBatteryVoltage() {
51 51
   uint16_t raw = analogRead(A0);
52 52
   float volt = raw / 1023.0;
53
-#ifdef BOARD_03962A
54
-  return volt * 6.79;
55
-#else
56 53
   return volt * 4.2;
57
-#endif
54
+
58 55
 }
59 56
 

Loading…
Cancel
Save