Jump to content
I2Cdevlib Forums

Recommended Posts

I am trying to get the MPU6050 example to compile and I can't seem to do it. I am using Arduino 1.0.5 on a Windows computer. 


So far, I have confirmed that the I2Cdev and the MPU6050 libraries are located in C:/Program Files (x86)/Arduino/Libraries. I have included the helper_3dmath library at the top of the example sketch, but I still cannot get it to compile. There is a long list of errors, but below are a couple. This seems to be an issue with the libraries I have included. 


C:\Users\Randy\Documents\Arduino\libraries\MPU6050/helper_3dmath.h: In member function 'float Quaternion::getMagnitude()':
C:\Users\Randy\Documents\Arduino\libraries\MPU6050/helper_3dmath.h:74: error: 'sqrt' was not declared in this scope
C:\Users\Randy\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:596: error: 'class VectorInt16' has no member named 'x'
C:\Users\Randy\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:597: error: 'class VectorInt16' has no member named 'y'
Please let me know if I am missing something obvious or if you will need more information to help. Thanks.
Link to comment
Share on other sites

  • 2 weeks later...

Update: I have no issues compiling and using this example on another computer. I am thinking that there is an issue with the libraries on my laptop. 


I have tried uninstalling and reinstalling Arduino, with no success. Does anyone know how to remove libraries from the Arduino IDE? Just deleting the folder doesn't seem to help, nor does uninstalling Arduino. Is there a configuration file hiding somewhere that the Arduino saves to and reads from?


Any ideas or suggestions at what might have gone wrong would be appreciated. 

Link to comment
Share on other sites

  • 1 year later...

Just for anyone running into this.


Make sure you include MPU6050 (folder) and I2CDev (folder) in your libraries for arduino (Usually User/MyDocs/Arduino/Libraries)

If you've done that and are still throwing errors, make sure you're using the right arduino.exe (yes you can have more than 1 installation).


My issue occured when I opened the wrong arduino and dragged in MPU6050 into an empty window.  This made the project "sketch_todays_date" instead of MPU6050.  The program was therefore processing out of the wrong window.  You want to make sure that MPU6050 is the only thing there / have the right pathing etc.

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.

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.

  • Create New...