Pages: [1]   Go Down
Author Topic: Corrected I2C Scanner Sketch- attached.  (Read 326 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The version of the sketch in error has this line of code:
Code:
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:
Wire.beginTransmission(address>>1);
The attached sketch is the corrected one.

* I2CScannerV2.ino (1.69 KB - downloaded 15 times.)
Logged

Pages: [1]   Go Up
Jump to: