Connection
PCF8591
Raspberry Pi
VCC
5V
GND
GND
SDA
SDA1
SCL
SCL1
Code Overview, Compile and run
The code is quite simple and we won't be changing it for the next couple of lessons, the same code can apply when
using the components as well.
Using the smbus library we connect to the port A0 address which we will be using in the next few lessons, then we
get the value and print it out, pretty straight forward. When no components are used the value won't change much
but when the components will be attached the value will changed based on the component.
Compile the script by going into the samples directory and running: python3 pcf8591.py
67 of 114
Need help?
Do you have a question about the Raspberry Pi & Arduino Starter Kit and is the answer not in the manual?