库识别不出树莓派所以报错,我也不知道库哪出了问题,可能时间太久远了。我直接去把它给的报错路径的文件里判断是不是树莓派这块板子的那行代码直接改成就是树梅派,问题就解决了。比如I2C.py里:
def get_default_bus():
"""Return the default bus number based on the device platform. For a
Raspberry Pi either bus 0 or 1 (based on the Pi revision) will be returned.
For a Beaglebone Black the first user accessible bus, 1, will be returned.
"""
#plat = Platform.platform_detect() ####这里注释掉换下面那行去判断
plat = Platform.RASPBERRY_PI
if plat == Platform.RASPBERRY_PI:
if Platform.pi_revision() == 1:
# Revision 1 Pi uses I2C bus 0.
return 0
。
。
。