April 2020
Intermediate to advanced
294 pages
7h 53m
English
For PCA8574, we are going to create a separate file, named PCA8574.py, that includes all the driver capabilities and functions for the I/O expander. We are going to use the PCA8574 class specification from the design of our RGB pushbutton application to guide our driver construction.
The first step is to create our class definition and constructor. The class will be named PCA8574_IO so that we have a little description as to what that chip actually is. The class initialization requires two pieces of information: an object that represents the initialized I2C bus and the slave address of PCA8574. This class can be instantiated multiple times for different addresses if we have more than one device connected to ...
Read now
Unlock full access