Jump to content
I2Cdevlib Forums

MPU-6050 Library Problems


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.

Link to comment
Share on other sites

  • 4 weeks later...

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

print(bus.getAccelXSelfTest())

 

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

Thanks a lot for your answers.

Link to comment
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?

Thanks

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...