Skip to Content
Raspberry Pi 3 Cookbook for Python Programmers - Third Edition
book

Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

by Steven Lawrence Fernandes, Tim Cox
April 2018
Beginner content levelBeginner
552 pages
13h 58m
English
Packt Publishing
Content preview from Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

Using I/O expanders

As we saw previously (in Chapter 10, Sensing and Displaying Real-World Data), wiringpi2 allows us to easily adjust our code to make use of I/O expanders using I2C. In this case, it can be useful to add additional circuits, such as sensors and LED status indicators, and perhaps even displays and control buttons, to assist with debugging and controlling the Rover-Pi robot as you develop it.

It can be particularly helpful if you intend to use it as a tethered device, since you will only require three wires to connect back to the Raspberry Pi (I2C Data GPIO Pin 3, I2C Clock GPIO Pin 5, and Ground GPIO Pin 6), with I2C VCC being provided by the motor controller 5V output.

As shown in the earlier example, add defines for the ...

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

Raspberry Pi for Python Programmers Cookbook - Second Edition

Raspberry Pi for Python Programmers Cookbook - Second Edition

Tim Cox

Publisher Resources

ISBN: 9781788629874Supplemental Content