[英]I got a error sensoring with L3GD20 in Raspberry pi 2B
I am creating a mobile robot, so I am using Raspberry Pi with Adafruit_I2C library, so I need to get Axis Z degree, the idea is to determine the angle when turning in a curve. 我正在创建一个移动机器人,因此我将Raspberry Pi与Adafruit_I2C库一起使用,因此我需要获取Axis Z轴度,其想法是确定弯道时的角度。 Code: def read(self):
代码:def读取(自己):
# Read gyro values
list = self.gyro.readList(self.L3GD20_REGISTER_OUT_X_L | 0x80, 6)
res = [(self.gyro16(list, 0)*self.sensitivity,
self.gyro16(list, 2)*self.sensitivity,
self.gyro16(list, 4)*self.sensitivity )]
return res
The error is this: 错误是这样的:
Traceback (most recent call last):
File "L3GD20.py", line 119, in <module>
print l3.read()
File "L3GD20.py", line 104, in read
res = [(self.gyro16(list, 0)*self.sensitivity,
AttributeError: 'L3GD20' object has no attribute 'sensitivity'
Someone knows how to fix this problem?? 有人知道如何解决这个问题吗? Thanks!!
谢谢!!
我认为您必须更改整个代码
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.