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

How it works...

The wiringpi2 library has excellent support for I/O expander chips, like the one used for the Adafruit LCD character module. To use the Adafruit module, we need to set up the pin mapping for all the pins of MCP23017 Port A, as shown in the following table (then, we set up the I/O expander pins with an offset of 100):

Name

SELECT

RIGHT

DOWN

UP

LEFT

GREEN

BLUE

RED

MCP23017 Port A

A0

A1

A2

A3

A4

A6

A7

A8

WiringPi pin

100

101

102

103

104

106

107

108

 

The pin mapping for all of MCP23017 Port B's pins is as follows:

Name

DB7

DB6

DB5

DB4

E

RW

RS

MCP23017 Port B

B1

B2

B3

B4

B5

B6

B7

WiringPi pin

109

110

111

112

113

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