Skip to content

Commit 9749aa2

Browse files
Fixed Pressure Measurement for BME280 Sensors
1 parent 18c8778 commit 9749aa2

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Sensatio_FW_ESP8266.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
SOURCE: https://github.com/sensate-io/firmware-esp8266.git
1212
1313
@section HISTORY
14+
v45 - Fixed Pressure Measurement for BME280 Sensors
1415
v44 - More Memory Improvements
1516
v43 - Fixed data transmit issues in configurations with many sensors
1617
v42 - Fixed low memory issues in configurations with many sensors and a ST7735 Bug
@@ -34,7 +35,7 @@
3435
VisualisationHelper* vHelper;
3536
Display* display = NULL;
3637

37-
int currentVersion = 44;
38+
int currentVersion = 45;
3839
boolean printMemory = false;
3940

4041
//String board = "Generic";

src/input/i2c/SensorBMx280.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
SOURCE: https://github.com/sensate-io/firmware-esp8266.git
1212
1313
@section HISTORY
14+
v45 - Fixed Pressure Measurement for BME280 Sensors
1415
v33 - Changes for Digital Sensor Switch Support
1516
v32 - Added MQTT Support!
1617
v29 - First Public Release
@@ -98,13 +99,13 @@ Data* SensorBMx280::read(bool shouldPostData)
9899
}
99100
else if(_calculation->getValueType()=="pressure")
100101
{
101-
float pressure = bme->pres() / 100.0F;
102+
float pressure = bme->pres(BME280::PresUnit_hPa);
102103
shouldPostData = smartSensorCheck(pressure, _smartValueThreshold, shouldPostData);
103104
return _calculation->calculate(this, pressure, shouldPostData);
104105
}
105106
else if(_calculation->getValueType()=="altitude")
106107
{
107-
float pressure = bme->pres() / 100.0F;
108+
float pressure = bme->pres(BME280::PresUnit_hPa);
108109
shouldPostData = smartSensorCheck(pressure, _smartValueThreshold, shouldPostData);
109110
return _calculation->calculate(this, pressure, shouldPostData);
110111
}

src/input/i2c/SensorBMx280.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
SOURCE: https://github.com/sensate-io/firmware-esp8266.git
1212
1313
@section HISTORY
14+
v45 - Fixed Pressure Measurement for BME280 Sensors
15+
v33 - Changes for Digital Sensor Switch Support
1416
v32 - Added MQTT Support!
1517
v29 - First Public Release
1618
*/
@@ -38,4 +40,4 @@ class SensorBMx280 : public Sensor {
3840
SensorBMx280 (long, String, String, String, String, int, int, float, SensorCalculation*);
3941
};
4042

41-
#endif
43+
#endif

0 commit comments

Comments
 (0)