Skip to Content
Learning Robotics using Python
book

Learning Robotics using Python

by Lentin Joseph
May 2015
Intermediate to advanced
330 pages
7h 18m
English
Packt Publishing
Content preview from Learning Robotics using Python

Interfacing MPU 6050 to Launchpad with the DMP support using Energia

In this section, we will see the interfacing code of MPU 6050 by activating DMP, which can give us direct orientation values in quaternion or yaw, pitch, and roll. This value can be directly applied to our robotic application too.

The following section of code imports all the necessary header files to interface and create an MPU6050 object like the previous code:

#include "Wire.h"
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"

//Creating MPU6050 Object
MPU6050 accelgyro(0x68);

The following code initializes and declares variables to handle DMP:

//DMP options //Set true if DMP initialization was successful bool dmpReady = false; //Holds actual interrupt status byte from ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Robotics using Python - Second Edition

Learning Robotics using Python - Second Edition

Lentin Joseph
Python Robotics Projects

Python Robotics Projects

Prof. Diwakar Vaish

Publisher Resources

ISBN: 9781783287536Supplemental Content