AS1170 Python Library
Description
This library allows control of the AS1170 driver via I2C and a GPIO Pin for Strobe control on Raspberry Pi, enabling LED management with simple commands like led.on() and led.off(). It also supports adjustable intensity and a strobe mode.
Installation
Since Raspberry Pi OS has stricter package management, it is recommended to install the library in a virtual environment to avoid conflicts.
1 Install Python Virtual Environment
If venv is not installed, run:
sudo apt install python3-venv
2 Create a Virtual Environment
Inside your project folder:
python3 -m venv venv
3 Activate the Virtual Environment
source venv/bin/activate
4 Install the Library
pip install as1170
5 AS1170 Setup
The default ID for the AS1170 is 0x30 but you can change it by using
led.set_id(0x31)
The default ID for the I2C Bus is the number 3 (GPIO Pins N. 4 and 5) but you can change it by using
led.set_i2c_bus(1)
6 Using the library
from as1170 import led
# Set LED intensity (in mA, range 0-450mA. Default led1=450 , led2=450)
led.set_intensity(led1=300, led2=200)
# Turn LEDs on
led.on()
# Wait for 1 second
time.sleep(1)
# Turn LEDs off
led.off()
7 Using the Strobe Mode
# Start strobe mode at 5 Hz (flashes until stopped manually)
led.strobe(frequency=5)
# Wait for 10 seconds while strobe is running
time.sleep(10)
# Stop the strobe and turn LEDs off
led.off()
8 Deactivate the Virtual Environment
deactivate
9 Uninstallation
To remove the library from your virtual environment:
pip uninstall as1170
If you want to completely remove the virtual environment:
rm -rf venv
Metadata
Release files for AS1170-Python 1.0.2
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 | |
|---|---|---|---|---|
| as1170_python-1.0.2.tar.gz | 5.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| as1170_python-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / as1170_python-1.0.2.tar.gz
| Download URL | as1170_python-1.0.2.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09b53f2ee553ac2c6fbf446fd75ea2fd44f737d31ba013d732fb0518edca1d49
|
|
BLAKE2b-256 checksum How to use checksums |
13da174374a1968aeca58cccc2be9b934c7620804431156a5c507b2bed7bbef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Release files / as1170_python-1.0.2-py3-none-any.whl
| Download URL | as1170_python-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f4b8908a3b31359e41139fdf87f904ac800424daa66b73a60f695d9be55871f
|
|
BLAKE2b-256 checksum How to use checksums |
595def0e11c98bd2c06433f9246d721d2cdc2a483b8d49186266e7899187b785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Security for AS1170-Python 1.0.2
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.