A replacement of the PCF8574 class for testing purposes on devices without i2c bus hardware.
Project description
PCF8574 simulation
This is a Python library you can use when working with the pcf8574 library. It works exactly the same as the original library, but is intended for testing purposes when the I²C-Bus hardware is not connected.
Installation
pip install pcf8574_simulation
Usage
You have different options to use this as an alternative to the original library.
For example, you can import the correct library depending on which is installed on your system:
try:
from pcf8574 import PCF8574, IOPort
except ImportError:
print("No I2C bus package found. Starting simulation")
from pcf8574_simulation import PCF8574, IOPort
Then you can use the PCF8574 class as usual:
pcf = PCF8574(1, 0x20)
print(pcf.port) # [True, True, True, True, True, True, True, True]
pcf.port[0] = False
print(pcf.port[0]) # False
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pcf8574_simulation-0.0.1.tar.gz.
File metadata
- Download URL: pcf8574_simulation-0.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fb8884fab6ab85a579b0f1be83b44670a6b9fe0ea6c7fe760f22f2201de25d5
|
|
| MD5 |
d8f4d97a4aa9445f91025dfce8f00334
|
|
| BLAKE2b-256 |
fb4685584767ab3c5fbb9ceadf89bb03ec172add63044ec8e45fa85e6c8ada0a
|
File details
Details for the file pcf8574_simulation-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pcf8574_simulation-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3403bfd11462f110bd225515eb045743e9cdd792d8ebc3ba2153968e5fd4d480
|
|
| MD5 |
0409601fd05e1467b03ab8b424198f36
|
|
| BLAKE2b-256 |
0664f1478fbb925fad8b63d3a53799d814f4dc53d48a21db016cf54b792171f0
|