Skip to content

Commit 63357a0

Browse files
committed
Fixed default setting bme.begin()
1 parent ba0bcdb commit 63357a0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Adafruit_BME280.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ bool Adafruit_BME280::begin(uint8_t addr, TwoWire *theWire)
6161
return init();
6262
}
6363

64+
bool Adafruit_BME280::begin(void)
65+
{
66+
_i2caddr = BME280_ADDRESS;
67+
_wire = &Wire;
68+
return init();
69+
}
70+
6471
bool Adafruit_BME280::init()
6572
{
6673
// init I2C or SPI sensor interface

Adafruit_BME280.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,11 @@ class Adafruit_BME280 {
165165
Adafruit_BME280(void);
166166
Adafruit_BME280(int8_t cspin);
167167
Adafruit_BME280(int8_t cspin, int8_t mosipin, int8_t misopin, int8_t sckpin);
168-
168+
169+
bool begin(void);
169170
bool begin(TwoWire *theWire);
170-
bool begin(uint8_t addr = BME280_ADDRESS);
171-
bool begin(uint8_t addr = BME280_ADDRESS, TwoWire *theWire = &Wire);
171+
bool begin(uint8_t addr);
172+
bool begin(uint8_t addr, TwoWire *theWire);
172173
bool init();
173174

174175
void setSampling(sensor_mode mode = MODE_NORMAL,

0 commit comments

Comments
 (0)