more specific debug during scan

This commit is contained in:
ladyada 2023-09-25 00:53:07 -04:00
parent 3ea940b745
commit fbba4799ad
1 changed files with 6 additions and 2 deletions

View File

@ -67,14 +67,18 @@ bool Adafruit_I2CDevice::detected(void) {
// A basic scanner, see if it ACK's
_wire->beginTransmission(_addr);
#ifdef DEBUG_SERIAL
DEBUG_SERIAL.print(F("Address 0x"));
DEBUG_SERIAL.print(_addr);
#endif
if (_wire->endTransmission() == 0) {
#ifdef DEBUG_SERIAL
DEBUG_SERIAL.println(F("Detected"));
DEBUG_SERIAL.println(F(" Detected"));
#endif
return true;
}
#ifdef DEBUG_SERIAL
DEBUG_SERIAL.println(F("Not detected"));
DEBUG_SERIAL.println(F(" Not detected"));
#endif
return false;
}