Go Down

Topic: Corrected I2C Scanner Sketch- attached. (Read 369 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy