Using Python smbus on a Raspberry Pi - confused with syntax
问题 I am trying to use python-smbus on a Raspberry Pi to communicate with an MMA7660 accelerometer chip using I2C. In the code below, I am reading registers 0x00, 0x01, 0x02 and 0x03 of the chip, and I am getting the exact same values for all. Looking at the values, and tilting the chip, I can see that they all correspond to register 0x00, the X value register. Output: ... 1 1 1 2 3 3 3 3 1 1 1 1 59 60 60 60 51 51 51 51 58 58 58 58 3 3 3 3 62 62 62 62 58 58 58 58 62 62 62 62 ... Code: import