У меня возникла ошибка определения ошибки с помощью L3GD20 в Raspberry pi 2B.Python

Программы на Python
Anonymous
У меня возникла ошибка определения ошибки с помощью L3GD20 в Raspberry pi 2B.

Сообщение Anonymous »


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. Code:

def read(self): # 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 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?


Источник: https://stackoverflow.com/questions/341 ... erry-pi-2b

Вернуться в «Python»