diff --git a/WeatherStation.ino b/WeatherStation.ino index 9f12f8b..c8cd5d6 100644 --- a/WeatherStation.ino +++ b/WeatherStation.ino @@ -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();