This Python code is about a i2c
-D/A
&A/D
- device, PCF8591
library using wiring pi
on Rasbperry pi 3. Plese feel free to use !
- Raspberry pi 3
- ubuntu16.04
- Python 3.x
- wiring pi
- PCF8591
$ sudo raspi-config
- Choose Advanced Option
- Enable i2c
PCF8591 --------- Raspberry pi3
SDA ------------- GPIO2/SDA1
SCL ------------- GPIO3/SCL1
VCC ------------- 3.3V
GND ------------- GND
- Model number : PCF8591
- Voltage : DC2.5V-6V
- Analog Input Voltage : 0V-5V
- Interface : i2c
- A/D Resolution : 8bit
$ python3 PCF8591.py
In this program, Raspberry pi read a variable register value(0-255) on PCF8591
default setting. And
output to LED(located at lowwer in this picture) which is on PCF8591 using Digital analog converter.
$ python3 DA&ADexample.py