Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Python for the Internet of Things

You're reading from   Getting Started with Python for the Internet of Things Leverage the full potential of Python to prototype and build IoT projects using the Raspberry Pi

Arrow left icon
Product type Course
Published in Feb 2019
Publisher
ISBN-13 9781838555795
Length 732 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (5):
Arrow left icon
Tim Cox Tim Cox
Author Profile Icon Tim Cox
Tim Cox
Prof. Diwakar Vaish Prof. Diwakar Vaish
Author Profile Icon Prof. Diwakar Vaish
Prof. Diwakar Vaish
Sai Yamanoor Sai Yamanoor
Author Profile Icon Sai Yamanoor
Sai Yamanoor
Steven Lawrence Fernandes Steven Lawrence Fernandes
Author Profile Icon Steven Lawrence Fernandes
Steven Lawrence Fernandes
Srihari Yamanoor Srihari Yamanoor
Author Profile Icon Srihari Yamanoor
Srihari Yamanoor
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (37) Chapters Close

Title Page
Copyright and Credits
About Packt
Contributors
Preface
1. Getting Started with a Raspberry Pi 3 Computer FREE CHAPTER 2. Dividing Text Data and Building Text Classifiers 3. Using Python for Automation and Productivity 4. Predicting Sentiments in Words 5. Detecting Edges and Contours in Images 6. Building Face Detector and Face Recognition Applications 7. Using Python to Drive Hardware 8. Sensing and Displaying Real-World Data 9. Building Neural Network Modules for Optical Character Recognition 10. Arithmetic Operations, Loops, and Blinky Lights 11. Conditional Statements, Functions, and Lists 12. Communication Interfaces 13. Data Types and Object-Oriented Programming in Python 14. File I/O and Python Utilities 15. Requests and Web Frameworks 16. Awesome Things You Could Develop Using Python 17. Robotics 101 18. Using GPIOs as Input 19. Making a Gardener Robot 20. Basics of Motors 21. Bluetooth-Controlled Robotic Car 22. Sensor Interface for Obstacle Avoidance 23. Making Your Own Area Scanner 24. Basic Switching 25. Recognizing Humans with Jarvis 26. Making Jarvis IoT Enabled 27. Giving Voice to Jarvis 28. Gesture Recognition 29. Machine Learning 30. Making a Robotic Arm 1. Other Books You May Enjoy Index

Reading analog data using anĀ analog-to-digital converter


The I2C tools (used in the previous section) are very useful for debugging I2C devices in the command line, but they are not practical for use within Python, as they would be slow and require significant overhead to use. Fortunately, there are several Python libraries that provide I2C support, allowing the efficient use of I2C to communicate with connected devices and providing easy operation.

We will use such a library to create our own Python module that will allow us to quickly and easily obtain data from the ADC device and use it in our programs. The module is designed in such a way that other hardware or data sources may be put in its place without impacting the remaining examples.

Getting ready

To use the I2C bus using Python 3, we will use Gordon Henderson's WiringPi2 (see http://wiringpi.com/ for more details).

The easiest way to install wiringpi2 is by using pip for Python 3. TheĀ pip is a package manager for Python that works...

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 $19.99/month. Cancel anytime
Banner background image