Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Android Things Projects

You're reading from  Android Things Projects

Product type Book
Published in Jun 2017
Publisher Packt
ISBN-13 9781787289246
Pages 232 pages
Edition 1st Edition
Languages
Author (1):
Francesco Azzola Francesco Azzola
Profile icon Francesco Azzola

Table of Contents (15) Chapters

Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
Getting Started with Android Things Creating an Alarm System Using Android Things How to Make an Environmental Monitoring System Integrate Android Things with IoT Cloud Platforms Create a Smart System to Control Ambient Light Remote Weather Station Build a Spying Eye Android with Android Things

Diving into I2C protocol


Until now, we have used I2C sensors and we have implemented a full working project without knowing much about I2C protocol and sensor-specific protocol. This is the power of Android Things: it abstracts the protocol details and we can use I2C sensors developing a normal Android app. This is also possible because we have used an external library in our project. If you remember at the beginning of this project we have included in build.gradle the library to manage the BMP280/BME280 sensor:

compile 'com.google.android.things.contrib:driver-bmx280:xx'

As long as we use peripherals that have a library to handle them we do not have to worry about the protocol details. When we use a peripheral that is not directly supported or there is not a library, we have to implement the specific peripheral protocol. In this context, it is important to know how I2C works.

I2C protocol overview

I2C stands for Inter Integrated Circuit. This is a serial communication protocol that uses two...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}