diff --git a/AM2320.cpp b/AM2320.cpp index 025e6e9..4a25bfd 100644 --- a/AM2320.cpp +++ b/AM2320.cpp @@ -27,9 +27,11 @@ void AM2320::begin() { Wire.begin(); } +#if defined(ESP8266) void AM2320::begin(int sda, int scl) { Wire.begin(sda, scl); } +#endif float AM2320::getTemperature() { return _temperature; diff --git a/AM2320.h b/AM2320.h index 9a4dffc..5cd57ed 100644 --- a/AM2320.h +++ b/AM2320.h @@ -31,9 +31,11 @@ class AM2320 { public: AM2320(); - // initialize AM2320 void begin(); + + #if defined(ESP8266) void begin(int sda, int scl); + #endif bool measure();