PCF8575
Python library for the PCF8575 I2C IO expander. It abstracts the 16 bit IO port as a Python list, and allows the read/writing of individual pins or the whole port at once. This is a modified version of the PCF8574 library to support the extra 8 ports.
Installation
The library depends on the smbus-cffi package. You may need to apt-get install libffi-dev if you're on a debian based system. Otherwise, simply:
pip install pcf8575
Usage
In [1]: from pcf8575 import PCF8575
In [2]: i2c_port_num = 1
In [3]: pcf_address = 0x20
In [4]: pcf = PCF8575(i2c_port_num, pcf_address)
In [5]: pcf.port
Out[5]: [True, True, True, True, True, True, True, True]
In [6]: pcf.port[0] = False
In [7]: pcf.port
Out[7]: [False, True, True, True, True, True, True, True]
In [8]: pcf.port = [True, False, True, False, True, False, True, False]
In [9]: pcf.port
Out[9]: [True, False, True, False, True, False, True, False]
In [10]: pcf.port[7]
Out[10]: False
In [11]: pcf.port[6]
Out[11]: True
Metadata
Release files for pcf8575 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pcf8575-0.3.tar.gz | 2.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pcf8575-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.9 kB
Release files / pcf8575-0.3.tar.gz
| Download URL | pcf8575-0.3.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aef516b568f5c565173954121ae61ee1f4b2cd87a9514b8357a0cdb65771561c
|
|
BLAKE2b-256 checksum How to use checksums |
a7ca59847f71b95b30114b79eefced82886b0b0aad9b316e07d321317ac78bbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8
|
Release files / pcf8575-0.3-py3-none-any.whl
| Download URL | pcf8575-0.3-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
827ee6d62c3358b239e36af8824bc5ee8b2795a88d9cce640b2f016050e2db86
|
|
BLAKE2b-256 checksum How to use checksums |
f4e806f3e3acc7acc115f5ca7aa1334fc7d28618ac3678a8e068dd28f1ac3fef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8
|