I ran into a bit of a weird problem a little while back when using I2C on Arduinos. I friend also had the problem recently so I figured maybe it was common enough that this post could help other people. The problem occurs when you have the master request a certain number of bytes from the slave. Except when the slave sends the bytes back, they all show up as -1 except for the last one. Here is some example code and a workaround solution.
Continue reading “Arduino i2c problem sending multiple bytes”