One more thing, in the sample code there is one line that seems wrong:
Wire.beginTransmission(address);
Wire.write(®, 1);
if ( Wire.endTransmission() != 0) {
return 0;
}
The
Wire.write(r,1)
line above is obviously wrong, but cant find what the correct line is. Any suggestions would be greatly appreciated