From f6d173bfc2c4877c96c370b65ebbebcf27791dc1 Mon Sep 17 00:00:00 2001 From: Bollie Date: Fri, 7 Dec 2018 19:30:15 +0100 Subject: [PATCH] Update max44009.cpp --- libraries/Max44009/max44009.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/Max44009/max44009.cpp b/libraries/Max44009/max44009.cpp index 4f5643b68..ed3663085 100644 --- a/libraries/Max44009/max44009.cpp +++ b/libraries/Max44009/max44009.cpp @@ -26,11 +26,12 @@ Max44009::Max44009(const uint8_t address, const uint8_t dataPin, const uint8_t clockPin) { _address = address; -#ifdef ESP8266 + if ((dataPin < 255) && (dataPin < 255)) + { Wire.begin(dataPin, clockPin); -#else // other platforms + } else { Wire.begin(); -#endif + } // TWBR = 12; // Wire.setClock(400000); _data = 0; _error = 0; @@ -181,4 +182,4 @@ void Max44009::write(uint8_t reg, uint8_t value) _error = Wire.endTransmission(); } -// --- END OF FILE --- \ No newline at end of file +// --- END OF FILE ---