April 2020
Intermediate to advanced
294 pages
7h 53m
English
The RGB pushbutton driver is going to be nothing more than a class that is a composition of RGB_Generator and the PCA8574_IO class that we have already created. This means that we are not going to add any additional methods to the class. Instead, we are going to use the constructor to initialize an RGB_Generator object and a PCA8574_IO object. The application code will then pass in the required parameters to initialize these objects. The implementation of this class can be seen in the following code:
from PCA8574 import PCA8574_IOfrom LED_RGB import RGB_Generatorclass PushButtonRGB: # Initializer / Instance Attributes def __init__(self, pin ist, timer, frequency, channels, i2cobject, slaveaddress): self ...
Read now
Unlock full access