You might be aware of this, but the endTransmission() returns always 0 (as its hardcoded on line 164), where it should return transmission status (where 0 = success), having 0 hardcoded will make sketches like this completely useless.
Code:
#include <Wire.h>
uint8_t address;
int8_t status;
void setup() {
Serial.begin(115200);
Wire.begin();
}
void loop() {
Serial.println("Scanning...");
for (address = 0; address <= 127; address++) {
Wire.beginTransmission(address);
status = Wire.endTransmission();
if (status == 0) {
Serial.print("I2C device found at: ");
Serial.println(address, HEX);
}
}
Serial.println("done");
delay(10000);
}