Fixed anemometer read and humidity value.

This commit is contained in:
klaute 2019-01-08 21:07:16 +01:00
parent c1b19add3b
commit 7bb62b5e4e
3 changed files with 9 additions and 15 deletions

View file

@ -4,8 +4,6 @@
#define BATTERY_POWERED 1
#define POWERSAVING 1
#define BOARD_03962A
#define SENSOR_TEMPERATURE 0
#define SENSOR_HUMIDITY 1
#define SENSOR_LIGHT 2

View file

@ -195,15 +195,14 @@ void _loop() {
currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature();
currentSensorData[SENSOR_HUMIDITY] = fetchHumidity();
currentSensorData[SENSOR_LIGHT] = fetchLight();
// Disable expensive tasks
if (energySavingMode() == 0) {
currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
} else {
currentSensorData[SENSOR_WINDSPEED] = -1;
}
currentSensorData[SENSOR_PRESSURE] = fetchPressure();
currentSensorData[SENSOR_BAT_VOLTAGE] = getBatteryVoltage();
// Disable expensive tasks
if (energySavingMode() == 0) {
currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
} else {
currentSensorData[SENSOR_WINDSPEED] = -1;
}
#ifdef DEBUG
Serial.println("");
@ -229,4 +228,4 @@ void _loop() {
}
//*************************************************************************//
//*************************************************************************//

View file

@ -13,7 +13,7 @@ float fetchPressure() {
}
float fetchHumidity() {
return bme.readHumidity();
return bme.readHumidity() * 2;
}
float fetchLight() {
@ -50,10 +50,7 @@ float fetchWindspeed() {
float getBatteryVoltage() {
uint16_t raw = analogRead(A0);
float volt = raw / 1023.0;
#ifdef BOARD_03962A
return volt * 6.79;
#else
return volt * 4.2;
#endif
}