[Bugfix] Make BMP180 sensor code work
The variable name was wrong, and Wire wasn’t initialized when the sensor was enabled.
This commit is contained in:
parent
b5dae4a1ce
commit
f69efbd224
@ -60,7 +60,7 @@ BH1750 light;
|
||||
#endif // HAVE_BH1750
|
||||
|
||||
#ifdef HAVE_BMP180
|
||||
Adafruit_BMP085 BMP;
|
||||
Adafruit_BMP085 bmp;
|
||||
#endif // HAVE_BMP180
|
||||
|
||||
#if SYSTEM_MODE & MODE_PROM_PULL
|
||||
@ -152,9 +152,11 @@ setup()
|
||||
pinMode(RAIN_PIN, INPUT);
|
||||
#endif // RAIN_PIN
|
||||
|
||||
#ifdef HAVE_BH1750
|
||||
#if defined(HAVE_BMP180) || defined(HAVE_BH1750)
|
||||
Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN);
|
||||
#endif // HAVE_BMP180 || HAVE_BH1750
|
||||
|
||||
#ifdef HAVE_BH1750
|
||||
if (!light.begin()) {
|
||||
Serial.println("Could not find the BH1750 sensor!");
|
||||
stop();
|
||||
|
Loading…
Reference in New Issue
Block a user