Skip to Content
Learning Robotics using Python - Second Edition
book

Learning Robotics using Python - Second Edition

by Lentin Joseph
June 2018
Beginner to intermediate
280 pages
6h 58m
English
Packt Publishing
Content preview from Learning Robotics using Python - Second Edition

Interfacing code of Energia

This code is used to read the raw value from MPU 6050 to Launchpad. It uses an MPU 6050 third-party library compatible with Energia IDE. The following are the explanations of each block of the code.

In this first section of code, we include the necessary headers for interfacing MPU 6050 to Launchpad, such as 12C, Wire and the MPU6050 library, and create an object of MPU6050 with the name accelgyro. The MPU6050.h library contains a class named MPU6050 to send and receive data to and from the sensor:

#include "Wire.h" 
 
#include "I2Cdev.h" 
#include "MPU6050.h" 
 
MPU6050 accelgyro; 

In the following section, we start the I2C and serial communication to communicate with MPU 6050 and print sensor values through the serial ...

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

Learning Robotics using Python

Lentin Joseph
Python Robotics Projects

Python Robotics Projects

Prof. Diwakar Vaish

Publisher Resources

ISBN: 9781788623315Supplemental Content