Metadata-Version: 2.2
Name: as1170
Version: 0.1.0
Summary: Library to control AS1170 LED driver via I2C on Raspberry Pi
Home-page: https://github.com/SupernovaIndustries/AS1170-Python
Author: Alessandro Cursoli
Author-email: alessandro.cursoli@supernovaindustries.it
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: smbus2
Requires-Dist: RPi.GPIO
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# AS1170 Python Library

## Description
This library allows control of the **AS1170** driver via **I2C** on **Raspberry Pi**, enabling LED management with simple commands like `led1.on()` and `led1.off()`.

## 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:
```sh
sudo apt install python3-venv
```

### 2?? Create a Virtual Environment
Inside your project folder:
```sh
python3 -m venv venv
```

### 3?? Activate the Virtual Environment
```sh
source venv/bin/activate
```

### 4?? Install the Library
```sh
pip install .
```

If you want to install it in **developer mode** (to modify the code without reinstalling):
```sh
pip install -e .
```

### 5?? Using the Library
```python
from as1170.driver import led1, led2

led1.on()
time.sleep(1)
led1.off()
```

### 6?? Deactivate the Virtual Environment
```sh
deactivate
```

## Installation Without Virtual Environment (Optional)
If you prefer a system-wide installation, you can force `pip` with:
```sh
pip install . --break-system-packages
```
? **Warning:** This might cause conflicts with system packages. A **virtual environment** is recommended.

---

## LED Control
Once installed, you can control the LEDs as follows:

```python
from as1170.driver import led1, led2

led1.on()  # Turns on LED1
led2.on()  # Turns on LED2

led1.off() # Turns off LED1
led2.off() # Turns off LED2
```

## Uninstallation
To remove the library from your virtual environment:
```sh
pip uninstall as1170
```
If you want to completely remove the virtual environment:
```sh
rm -rf venv
```
