Skip to content

Commit f6d173b

Browse files
authored
Update max44009.cpp
1 parent ba645e5 commit f6d173b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libraries/Max44009/max44009.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
Max44009::Max44009(const uint8_t address, const uint8_t dataPin, const uint8_t clockPin)
2727
{
2828
_address = address;
29-
#ifdef ESP8266
29+
if ((dataPin < 255) && (dataPin < 255))
30+
{
3031
Wire.begin(dataPin, clockPin);
31-
#else // other platforms
32+
} else {
3233
Wire.begin();
33-
#endif
34+
}
3435
// TWBR = 12; // Wire.setClock(400000);
3536
_data = 0;
3637
_error = 0;
@@ -181,4 +182,4 @@ void Max44009::write(uint8_t reg, uint8_t value)
181182
_error = Wire.endTransmission();
182183
}
183184

184-
// --- END OF FILE ---
185+
// --- END OF FILE ---

0 commit comments

Comments
 (0)