Metadata-Version: 2.1
Name: ws2812-gpt-lp
Version: 0.1.1
Summary: A library to control WS2812 LEDs using SPI on Orange Pi
Author: ChatGPT
Author-email: Laurent Pastor <l.pastor@free.fr>
License: MIT
Project-URL: Homepage, https://github.com/l-pastor/ws2812-gpt-lp
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: spidev

# WS2812-GPT-LP

This library allows you to control WS2812 LEDs using SPI on Orange Pi.
Cette bibliothèque permet de contrôler les LEDs WS2812 via SPI sur Orange Pi.

## Installation

pip install ws2812-gpt-lp

## Usage

from ws2812_gpt_lp import WS2812

# Configuration
num_leds = 8<br>
ws2812 = WS2812(spi_bus=4, spi_device=0, num_leds=num_leds)

# Set colors for 8 LEDs
colors = [<br>
    (255, 0, 0),  # Red<br>
    (0, 255, 0),  # Green<br>
    (0, 0, 255),  # Blue<br>
    (255, 255, 0),  # Yellow<br>
    (0, 255, 255),  # Cyan<br>
    (255, 0, 255),  # Magenta<br>
    (255, 255, 255),  # White<br>
    (0, 0, 0)     # Black (off)<br>
]

# Send colors to LEDs
ws2812.send_colors(colors)

# Change the color of the first LED to blue
ws2812.send_color(0, 0, 0, 255)

# Turn off all LEDs
ws2812.send_off()

# Set all LEDs to red
ws2812.send_to_all(255, 0, 0)

# Close the SPI connection
ws2812.close()

## Note

You must solder a 100nF capacitor between the VCC and GND of the WS2812 LEDs to avoid interference.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Authors

This library was jointly developed by Laurent Pastor and ChatGPT 4.
