Fixed anemometer read and humidity value.
This commit is contained in:
parent
c1b19add3b
commit
7bb62b5e4e
3 changed files with 9 additions and 15 deletions
|
@ -4,8 +4,6 @@
|
||||||
#define BATTERY_POWERED 1
|
#define BATTERY_POWERED 1
|
||||||
#define POWERSAVING 1
|
#define POWERSAVING 1
|
||||||
|
|
||||||
#define BOARD_03962A
|
|
||||||
|
|
||||||
#define SENSOR_TEMPERATURE 0
|
#define SENSOR_TEMPERATURE 0
|
||||||
#define SENSOR_HUMIDITY 1
|
#define SENSOR_HUMIDITY 1
|
||||||
#define SENSOR_LIGHT 2
|
#define SENSOR_LIGHT 2
|
||||||
|
|
|
@ -195,15 +195,14 @@ void _loop() {
|
||||||
currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature();
|
currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature();
|
||||||
currentSensorData[SENSOR_HUMIDITY] = fetchHumidity();
|
currentSensorData[SENSOR_HUMIDITY] = fetchHumidity();
|
||||||
currentSensorData[SENSOR_LIGHT] = fetchLight();
|
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_PRESSURE] = fetchPressure();
|
||||||
currentSensorData[SENSOR_BAT_VOLTAGE] = getBatteryVoltage();
|
currentSensorData[SENSOR_BAT_VOLTAGE] = getBatteryVoltage();
|
||||||
|
// Disable expensive tasks
|
||||||
|
if (energySavingMode() == 0) {
|
||||||
|
currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
|
||||||
|
} else {
|
||||||
|
currentSensorData[SENSOR_WINDSPEED] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
|
@ -229,4 +228,4 @@ void _loop() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//*************************************************************************//
|
//*************************************************************************//
|
||||||
|
|
|
@ -13,7 +13,7 @@ float fetchPressure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
float fetchHumidity() {
|
float fetchHumidity() {
|
||||||
return bme.readHumidity();
|
return bme.readHumidity() * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
float fetchLight() {
|
float fetchLight() {
|
||||||
|
@ -50,10 +50,7 @@ float fetchWindspeed() {
|
||||||
float getBatteryVoltage() {
|
float getBatteryVoltage() {
|
||||||
uint16_t raw = analogRead(A0);
|
uint16_t raw = analogRead(A0);
|
||||||
float volt = raw / 1023.0;
|
float volt = raw / 1023.0;
|
||||||
#ifdef BOARD_03962A
|
|
||||||
return volt * 6.79;
|
|
||||||
#else
|
|
||||||
return volt * 4.2;
|
return volt * 4.2;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue