我已将waveshare 10dof IMU连接到我的覆盆子 .

sudo i2cdetect -y 1

告诉我

0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

所以,这很好 . 我安装了 i2c-toolspython-smbus

接下来,我尝试从我的IMU读取数据 . 我写了下一段代码:

import os
import smbus
import time

bus = smbus.SMBus(1)
address = 0x68

def pr():
    os.system('clear')
    cnt = 26
    for i in range(1, cnt):
        x = bus.read_byte_data(address, i)
        print x

while True:
    time.sleep(0.2)
    pr()

我的结果是:

206
224
222
171
254
233
32
29
211
27
255
0
108
101
125
217
217
231
0
0
0
0
0

当我移动IMU时它没有改变 .

请帮我理解:为什么?如何修复它,出了什么问题?

谢谢!