Skip to content

Commit d2b66ea

Browse files
authored
Added setSampling() to BME280 (#413)
1 parent f0c8aad commit d2b66ea

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,12 @@ Each sensor class may expose additional methods.
647647
void setForecastSamplesCount(int value);
648648
~~~
649649

650+
* SensorBME280
651+
~~~c
652+
// set custom sampling to the sensor
653+
void setSampling(Adafruit_BME280::sensor_mode mode, Adafruit_BME280::sensor_sampling tempSampling, Adafruit_BME280::sensor_sampling pressSampling, Adafruit_BME280::sensor_sampling humSampling, Adafruit_BME280::sensor_filter filter, Adafruit_BME280::standby_duration duration);
654+
~~~
655+
650656
* SensorSonoff
651657
~~~c
652658
// [101] set the button's pin (default: 0)

sensors/SensorBME280.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class SensorBME280: public SensorBosch {
4343
new Child(this,FLOAT,nodeManager.getAvailableChildId(child_id+2),S_BARO,V_PRESSURE,_name);
4444
new Child(this,STRING,nodeManager.getAvailableChildId(child_id+3),S_BARO,V_FORECAST,_name);
4545
};
46+
47+
// set custom sampling to the sensor
48+
void setSampling(Adafruit_BME280::sensor_mode mode, Adafruit_BME280::sensor_sampling tempSampling, Adafruit_BME280::sensor_sampling pressSampling, Adafruit_BME280::sensor_sampling humSampling, Adafruit_BME280::sensor_filter filter, Adafruit_BME280::standby_duration duration) {
49+
_bm->setSampling(mode,tempSampling,pressSampling,humSampling,filter,duration);
50+
}
4651

4752
// define what to do during setup
4853
void onSetup() {

0 commit comments

Comments
 (0)