Jump to content
I2Cdevlib Forums

Recommended Posts

Hi, I'm trying to compile the MPU6050_DMP6 sketch and am having a lot of problems with unrecognized .h files.  First of all the IDE couldn't find the i2Cdev.h file.  I tried installing the library "i2cdevlib-master" as a zip file and manually but I keep getting and invalid library message.  I also tried installing manually and changing the folder name by removing "-" but that didn't work.  So, I tried placing the individual .h files into the library folder which works but there are so many of them that it's impossible to get them all that way.  It seems that there are many libraries referenced in the MPU6050 example sketch and many of them are not loaded by default in the IDE.  For example "nordic_common.h".  I can't figure out what libraries need to be installed and I also have trouble loading them.  Any help would be appreciated.

In summary, where can I get all the libraries required to compile the MPU6050 example sketches and how can they be loaded.  Let's just start there.

Share this post

Link to post
Share on other sites

Hi everyone

This is my first attempt to sensor programming, so please describe everything from basics on thanks.

I want to use the the given methods of I2c. 

As an example the getAccelXSelfTest(). To use it I tried this (here simplificated) code:


import smbus

bus = smbus.SMBus(1)

address  = 0x68



What is wrong with it. How do I have to call These methods?

Thanks a lot for your answers.

Share this post

Link to post
Share on other sites

I got an answer from elsewhere and want to Share it. 

The problem is that the function getAccelXSelfTest is a basic function and written in C++. I am using Python for the rest of my Code. To use this function you would have to use an implementet function in C++. 

In Python you could Just read the register 0xD.

Pm does sb knows how to just read one Bit of the register?



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now