SM16relind
This is the python library to control the Sixteen Relays 8-Layer Stackable HAT for Raspberry Pi.
Install
sudo pip install SM16relind
or (if using python3.x):
sudo pip3 install SM16relind
Update
sudo pip install SM16relind -U
or (if using python3.x):
sudo pip3 install SM16relind -U
Manual installation (without pip)
~$ sudo apt-get update
~$ sudo apt-get install build-essential python-pip python-dev python-smbus git
~$ git clone https://github.com/SequentMicrosystems/16relind-rpi.git
~$ cd 16relind-rpi/python/
~/16relind-rpi/python$ sudo python setup.py install
If you use python3.x repace the last line with:
~/16relind-rpi/python$ sudo python3 setup.py install
Manual update (only if installed without pip)
~$ cd 16relind-rpi/
~/16relind-rpi$ git pull
~$ cd 16relind-rpi/python
~/16relind-rpi/python$ sudo python setup.py install
If you use python3.x repace the last line with:
~/16relind-rpi/python$ sudo python3 setup.py install
Usage example
~$ python
Python 3.10.7 (main, Nov 7 2022, 22:59:03) [GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import SM16relind
>>> rel = SM16relind.SM16relind(0)
>>> rel.set(1, 1)
>>> rel.get_all()
1
>>>
More usage example in the examples folder
Functions prototype
class SM16relind.SM16relind(stack = 0, i2c = 1)
- Description
- Init the SM16relind object and check the card presence
- Parameters
- stack : Card stack level [0..7] set by the jumpers
- i2c : I2C port number, 1 - Raspberry default , 7 - rock pi 4, etc.
- Returns
- card object
set(relay, val)
- Description
- Set one relay state
- Parameters
- relay: The relay number 1 to 16
- val: The new state of the relay 0 = turn off else turn on
- Returns
- none
set_all(val)
- Description
- Set the state of all relays as a 16 bits bit-map
- Parameters
- val: The new state of all 16 relays, 0 => all off, 15 => all on
- Returns
- none
get(relay)
- Description
- Read one relay state
- Parameters
- relay relay number [1..16]
- Returns
- the state of the relay 0 or 1
get_all()
- Description
- Read the state of all 16 relays
- Parameters
- none
- Returns
- relays state as bitmap [0..65535]
Metadata
Release files for sm16relind 1.0.4
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 | Actions |
|---|---|---|---|---|
| sm16relind-1.0.4.tar.gz | 4.4 kB | Without provenance | Details for sm16relind-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sm16relind-1.0.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for sm16relind-1.0.4-py2.py3-none-any.whl |
Total release size: 9.4 kB
Release files / sm16relind-1.0.4.tar.gz
| Download URL | sm16relind-1.0.4.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4f3f53385e46095ce546c56e30016bb5a18f92266f025a01e2b411292e7e7a6
|
|
BLAKE2b-256 checksum How to use checksums |
b6fb8759c6d8b4976bca357bfb1f9c165599602a465710cd3ad5db16fcdf7cc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.2
|
Release files / sm16relind-1.0.4-py2.py3-none-any.whl
| Download URL | sm16relind-1.0.4-py2.py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
89e6754b8d43dfc13ead49516b1b240dab6bf62e2437511d9fdeb491540d4939
|
|
BLAKE2b-256 checksum How to use checksums |
3bbd9b2dcb43a5d6eee3e4fee591eee4afe8863e278aad6d5c531ecdcf4b54aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.2
|
Security for sm16relind 1.0.4
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.