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

I0Error #15

Closed
mspalluzzi opened this issue Apr 30, 2017 · 6 comments
Closed

I0Error #15

mspalluzzi opened this issue Apr 30, 2017 · 6 comments

Comments

@mspalluzzi
Copy link

Hey, seems like I've gotten the module installed correctly but when trying to run some sample code just to check if it will compile:

`from time import sleep
import RPi.GPIO as GPIO
from mpu6050 import mpu6050

sensor = mpu6050(0x68)

while True:
accel_data = sensor.get_accel_data()
gyro_data = sensor.get_gyrp_data()
temp = sensor.get_temp()
`
I get this error:

2017-04-30-105728_1824x984_scrot

Any ideas what that may be referring to / how to fix?
Looking into that directory it seems like all the files are properly placed.
Using Pi 3 if that changes anything.

Thanks!

@Jimit04
Copy link

Jimit04 commented Apr 30, 2017

Run code with sudo.

@m-rtijn
Copy link
Owner

m-rtijn commented Apr 30, 2017

Thank you for using my module!

As @Jimit04 stated, you need to run the code using sudo to get access to the I2C bus.

@m-rtijn m-rtijn closed this as completed Apr 30, 2017
@mspalluzzi
Copy link
Author

Thanks for the quick response!
However, trying to run the code with sudo I'm getting the same error.

I did notice that I didnt do the pip install using sudo (seems like that would need elevated privileges?) so I went back through the whole process using sudo and I got the same error.

@m-rtijn
Copy link
Owner

m-rtijn commented Apr 30, 2017

Check if you have enabled I2C with raspi-config.

@mspalluzzi
Copy link
Author

There it is!

Thanks for the help and the great module!

@m-rtijn
Copy link
Owner

m-rtijn commented Apr 30, 2017

No problem.

@m-rtijn m-rtijn mentioned this issue Mar 10, 2018
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

3 participants