1
0
mirror of https://github.com/richardghirst/PiBits.git synced 2024-11-28 12:24:11 +01:00
PiBits/MPU6050-Pi-Demo
2014-02-11 19:51:26 +00:00
..
demo_3d.cpp Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
demo_3d.h Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
demo_dmp.cpp Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
demo_raw.cpp Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
helper_3dmath.h Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
I2Cdev.cpp Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
I2Cdev.h Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
main_3d.cpp Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
Makefile Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
MPU6050_6Axis_MotionApps20.h fixed bug in MPU6050_6Axis_MotionApps20.h function uint8_t MPU6050::dmpInitialize() which caused an i2c-read error in case of an empty fifoCount. 2013-12-23 00:53:34 +01:00
MPU6050.cpp Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
MPU6050.h Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00
README Add note to edit I2Cdev.cpp for Rev 2 boards 2014-02-11 19:51:26 +00:00
setup-i2c.sh Added the MPU6050 demo code 2013-01-29 21:16:52 +00:00

This code is mostly

Copyright (c) 2012 Jeff Rowberg, and copied from

    https://github.com/jrowberg/i2cdevlib

I have simply hacked it to work with the RaspberryPi, using the in-kernel
I2C drivers.  It should be trival to make use of any of the other sensors
Jeff supports in this way.

You need libgtkmm-3.0-dev installed in order to build the 3d demo.

NOTE: If you have a revision 2 Raspberry Pi you need to edit I2Cdev.cpp
      and change all references to "/dev/i2c-0" to read "/dev/i2c-1".

'make' will create three demos:

demo_raw - displays raw gyro and accel values.
demo_dmp - displays yaw, pitch and roll angles, etc, using the DMP.  See the
           source to enable different output data.
demo_3d  - displays a wireframe 'model' on the screen which you can rotate
           on all three axes by moving the MPU6050.

The demo_3d code is mostly mine, not Jeff's, and is a pretty ugly mix of C and
C++, but it works well enough for a demo.

To make the most of this code you need to get an MPU6050 and hook it up
to the I2C interface on your Pi.  You can "make test_3d" if you just want
to play with the wireframe model without an MPU6050.

Note the DMP FIFO rate has been set to 20Hz in the Makefile; it is 100Hz in the
original code, but that was a bit fast for the 3d demo.  See the comments in
MPU6050_6Axis_MotionApps20.h file to change the rate.


Richard Hirst <richardghirst@gmai.com>   06 Nov 2012