Go Down

Topic: Corrected I2C Scanner Sketch- attached. (Read 348 times) previous topic - next topic

louarnold

The version of the sketch in error has this line of code:
Code: [Select]
Wire.beginTransmission(address);
The sketch with that line will report the incorrect device address because the beginTransmission() method requires a right-shifted address value and the sketch sends it and reports the unshifted address. The correct code line is:
Code: [Select]
Wire.beginTransmission(address>>1);
The attached sketch is the corrected one.

Go Up