Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'module' object is not callable #33

Open
MarCixn opened this issue Dec 18, 2020 · 1 comment
Open

TypeError: 'module' object is not callable #33

MarCixn opened this issue Dec 18, 2020 · 1 comment

Comments

@MarCixn
Copy link

MarCixn commented Dec 18, 2020

python3 sensor.py

Traceback (most recent call last):
File "sensor.py", line 3, in
mpu = mpu6050(0x68)
TypeError: 'module' object is not callable

my code:

from mpu6050 import mpu6050
import time
mpu = mpu6050(0x68)

while True:
    print("Temp : "+str(mpu.get_temp()))
    print()

    accel_data = mpu.get_accel_data()
    print("Acc X : "+str(accel_data['x']))
    print("Acc Y : "+str(accel_data['y']))
    print("Acc Z : "+str(accel_data['z']))
    print()

    gyro_data = mpu.get_gyro_data()
    print("Gyro X : "+str(gyro_data['x']))
    print("Gyro Y : "+str(gyro_data['y']))
    print("Gyro Z : "+str(gyro_data['z']))
    print()
    print("-------------------------------")
    time.sleep(1)
@l-shannan
Copy link

l-shannan commented Jan 13, 2021

I am using the same code and get the same error when trying to run in python3.

if i try to run in python i get

Traceback (most recent call last):
File "6050.py", line 3, in
mpu = mpu6050(0x68)
File "/home/pi/.local/lib/python2.7/site-packages/mpu6050/mpu6050.py", line 60, in init
self.bus.write_byte_data(self.address, self.PWR_MGMT_1, 0x00)
IOError: [Errno 121] Remote I/O error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants