And when all else fails, its actually not to hard to create your own part (hardest part is navigating the documentation).
If you want to make full use of the I2Cdev or MPU6050 libraries and their functions, consult their header files.Fritzing import image. Once you're happy that it all works properly you can begin experimenting with it for your own projects. Now pick up the gyro and test out the yaw / pitch / roll. Last of all, open the Processing application file and thenĬ:\Program Files (x86)\Arduino\libraries\MPU6050\Examples\MPU6050_DMP6\Processing\MPUTeapotĬlick the play button and the system should calibrate for about 20-30 seconds, leave the gyro stationary during that period. Unzip ToxicLibs and place ALL the contents there. The "libraries" folder of Processing can be found by following (starting from within the processing folder): modes -> java -> libraries. The latest version of the ToxicLibs library is here: This library will be going into Processing's libraries folder instead of Arduino's.
We'll need one final library to get things running: ToxicLib. Download Processing from here, then unzip to wherever you like: However the Arduino IDE will only be acquiring the data, to display the 3D simulation we'll need additional software: Processing.
Upload again but don't open the serial window this time.ĭownload & Install Latest Version Of Processing & ToxicLibs Library To run a 3D simulation of the yaw / pitch / roll values on an airplane on the screen, we'll be running the teapot demo from the MPU6050_DMP6 example from Jeff Rowberg's MPU6050 libary. Select "save as" and choose where you want to save the modified code.
#define OUTPUT_READABLE_YAWPITCHROLL and uncomment the line Close the serial window, then find and comment out the line
Now we want to set the code to run the teapot demo to show the 3D simulation. You can test the data collection by typing anything in the text bar and pressing enter, the data should start showing up. You should be prompted that the MPU6050 connection was successful. In the Serial Window, select a baud rate of 115200. Open it, plug your arduino in, select the appropriate COM Port and upload the sketch. Then open the Arduino IDE and in the examples section, you should find MPU6050_DMP6 within MPU6050. Once unzipped, find the Arduino folder within it and copy the two folders "I2Cdev" and "MPU6050" over to your Arduino "libraries" folder in the following directory:
They are available as a zip file from here: Good thing someone has already done the hard work for us Jeff Rowberg wrote some Arduino libraries to obtain the accelerometer / gyro data and handle all the calculations. I f we were to write the code from scratch, it would take ages and there would be a lot of reverse engineering required to make good use of the module's proprietary Digital Motion Processing (DMP) engine because Invensense intentionally released minimal data on its MPU6050.
You'll learn to wire a simple circuit to test your MPU6050 with an Arduino and simulate the YAW, PITCH and ROLL on a 3D model plane on the screen.