bmp180: give sda,scl param in constructor

This commit is contained in:
Mathieu Maret 2016-03-26 15:30:18 +01:00
parent 55beced1f8
commit ce1f4fc3b2
3 changed files with 5 additions and 5 deletions

View File

@ -9,12 +9,12 @@ int bmp180Connected = 0;
int BMP180GetTemperature(double &t);
int BMP180GetTempAndPressure(double &t, double &p);
int BMP180Setup();
int BMP180Setup(int sda, int scl);
bool BMP180IsConnected();
#else //ENABLE_BMP80
int BMP180GetTemperature(double &t){return 0;};
int BMP180GetTempAndPressure(double &t, double &p){return 0;};
int BMP180Setup(){return 0;};
int BMP180Setup(int , int ){return 0;};
bool BMP180IsConnected(){return 0;};
#endif

View File

@ -1,7 +1,7 @@
#ifdef ENABLE_BMP180
#include "BMP180.h"
int BMP180Setup() {
bmp180Connected = bmp180.begin(SDA, SCL);
int BMP180Setup(int sda, int scl) {
bmp180Connected = bmp180.begin(sda, scl);
return bmp180Connected;
}

View File

@ -197,7 +197,7 @@ void setup() {
if (mode == BOOTMODE_OTA) {
OTASetup();
} else {
if (BMP180Setup())
if (BMP180Setup(SDA, SCL))
SKETCH_DEBUG_PRINTLN("BMP180 init success");
WebSetupServer(mode);
}