OctofetPi
Raspberry Pi library to interface with the Amperka Octofet 8-channel power switches.
Installation
If you haven’t enabled SPI support in your Raspbian Linux yet, open the terminal and run the following commands:
- Run
sudo raspi-config. - Use the down arrow to select
5 Interfacing Options. - Arrow down to
P4 SPI. - Select
<Yes>when it asks you to enable SPI. - Press
<Ok>when it tells you that SPI is enabled. - Use the right arrow to select the
<Finish>button. - Reboot your Raspberry Pi to make the SPI interface appear.
After reboot, log in and enter the following command:
$ ls /dev/spi*
The Pi should respond with:
/dev/spidev0.0 /dev/spidev0.1
These represent SPI devices on chip enable pins 0 and 1, respectively. These pins are hardwired within the Pi.
Then use pip to install the library:
pip3 install octofet
API
Quickstart example:
import time
import octofet
# Create an Octofet object connected to the CE0 pin of the Raspberry Pi board.
octo = octofet.Octofet(0)
# Switch state variable.
state = True
while True:
# For each switch.
for switch in range(8):
# Set the current state for the switch.
octo.digital_write(switch, state)
# Wait 1 second.
time.sleep(1)
# Toogle state.
state = not state
See full API reference in API.md.
Metadata
Release files for octofet 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| octofet-1.0.0.tar.gz | 15.6 kB | Without provenance | Details |
Release files / octofet-1.0.0.tar.gz
| Download URL | octofet-1.0.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a29f0a3c458da1085787a7dd8d9986ed55fd50eacab0814a682a018efd2bbcc1
|
|
BLAKE2b-256 checksum How to use checksums |
bb301f2b7379adacc5f2aa360bc70cd6cc10bc16d932482fd92700ca9d93ef45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Security for octofet 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.