Skip to Content
Internet of Things with Python
book

Internet of Things with Python

by Gastón C. Hillar
May 2016
Intermediate to advanced content levelIntermediate to advanced
388 pages
9h 9m
English
Packt Publishing
Content preview from Internet of Things with Python

Controlling digital outputs with the wiring-x86 library

One of the great advantages of working with Python as our programming language to interact with the board is that we have plenty of packages available for Python. We have been using the mraa library to interact with the digital outputs. However, in the previous chapter, we also installed the wiring-x86 library. We can change just a few lines of our object-oriented code to replace the mraa library with the wiring-x86 one to turn on and off the LEDs.

The following lines shows the code for a Board class followed by the new version of the Led class that works with the wiring-x86 library instead of using mraa. The code file for the sample is iot_python_chapter_03_07.py.

from wiringx86 import GPIOGalileoGen2 ...
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

Getting Started with Python for the Internet of Things

Getting Started with Python for the Internet of Things

Tim Cox, Dr. Steven Lawrence Fernandes, Sai Yamanoor, Srihari Yamanoor, Prof. Diwakar Vaish

Publisher Resources

ISBN: 9781785881381Supplemental Content