Pi5Neo


NamePi5Neo JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://github.com/vanshksingh/pi5neo
SummaryA NeoPixel LED control library for Raspberry Pi 5 using SPI
upload_time2024-09-15 19:26:27
maintainerNone
docs_urlNone
authorVansh Kumar Singh
requires_python>=3.6
licenseNone
keywords raspberrypi5 neopixel spi led-strip hardware
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pi5Neo

### Simplifying NeoPixel LED Control on Raspberry Pi 5 via SPI (GPIO 10)

[![PyPI version](https://badge.fury.io/py/Pi5Neo.svg)](https://badge.fury.io/py/Pi5Neo) 
[![Python Versions](https://img.shields.io/pypi/pyversions/Pi5Neo.svg)](https://pypi.org/project/Pi5Neo)
[![License](https://img.shields.io/github/license/vanshksingh/Pi5Neo)](LICENSE)

![IMG_7596](https://github.com/user-attachments/assets/6fb727ae-789e-4d25-9dd7-38599fdbb81e)

Pi5Neo is a Python library designed to make controlling **NeoPixel LED strips** super easy and efficient on the **Raspberry Pi 5** (or equivalent boards). Whether you're creating dazzling light shows, informative displays, or ambient lighting, Pi5Neo simplifies the process using the Raspberry Pi’s **SPI interface** for high-performance communication.

## 🌟 Key Features

- **Easy NeoPixel Control**: Send commands to any NeoPixel LED strip connected to the Raspberry Pi 5’s SPI interface.
- **Smooth Transitions**: Enjoy vibrant color transitions with rainbow effects, loading bars, blinking patterns, and more.
- **Optimized for Performance**: Tailored for the Raspberry Pi 5, ensuring fast and reliable communication with NeoPixel strips.
- **Minimalistic API**: A simple API lets you focus on creativity without worrying about low-level hardware details.
- **Flexible Configurations**: Control various effects and animations by easily setting colors, durations, and brightness levels.

## πŸš€ Installation

You can install Pi5Neo via `pip`:

```bash
pip install pi5neo
```

### Requirements
- **Python 3.6+**
- **spidev** (automatically installed with Pi5Neo)

### Hardware
- **Raspberry Pi 5** (or equivalent with SPI interface)
- **NeoPixel LED Strip** (WS281x family)

## πŸ“š Usage

Pi5Neo makes it straightforward to set up and control your NeoPixel strip. Here's a simple example:

```python
from pi5neo import Pi5Neo

# Initialize the Pi5Neo class with 10 LEDs and an SPI speed of 800kHz
neo = Pi5Neo('/dev/spidev0.0', 10, 800)

# Fill the strip with a red color
neo.fill_strip(255, 0, 0)
neo.update_strip()  # Commit changes to the LEDs

# Set the 5th LED to blue
neo.set_led_color(4, 0, 0, 255)
neo.update_strip()
```

## 🌈 Examples

You can find more advanced examples in the [examples](examples) directory. Here’s a quick showcase of some cool effects you can create with Pi5Neo:

### Example 1: Rainbow Cycle
```python
from pi5neo import Pi5Neo
import time

def rainbow_cycle(neo, delay=0.1):
    colors = [
        (255, 0, 0),  # Red
        (255, 127, 0),  # Orange
        (255, 255, 0),  # Yellow
        (0, 255, 0),  # Green
        (0, 0, 255),  # Blue
        (75, 0, 130),  # Indigo
        (148, 0, 211)  # Violet
    ]
    for color in colors:
        neo.fill_strip(*color)
        neo.update_strip()
        time.sleep(delay)

neo = Pi5Neo('/dev/spidev0.0', 10, 800)
rainbow_cycle(neo)
```

### Example 2: Loading Bar Effect
```python
from pi5neo import Pi5Neo
import time

def loading_bar(neo):
    for i in range(neo.num_leds):
        neo.set_led_color(i, 0, 255, 0)  # Green loading bar
        neo.update_strip()
        time.sleep(0.2)
    neo.clear_strip()
    neo.update_strip()

neo = Pi5Neo('/dev/spidev0.0', 10, 800)
loading_bar(neo)
```


## βš™οΈ Configuration

You can configure Pi5Neo by passing in different parameters for the number of LEDs, SPI speed, and more:

```python
Pi5Neo('/dev/spidev0.0', num_leds=20, spi_speed_khz=1000)
```

- **`/dev/spidev0.0`**: SPI device path
- **`num_leds`**: Number of LEDs in the NeoPixel strip
- **`spi_speed_khz`**: SPI speed in kHz (default 800)

## πŸ› οΈ Contributing

We welcome contributions from the community! To contribute:

1. Fork the repo.
2. Create a new branch (`git checkout -b my-feature`).
3. Commit your changes (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin my-feature`).
5. Create a new Pull Request.

Feel free to open issues for bugs, questions, or feature requests.

## πŸ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ❀️ Acknowledgements

Pi5Neo was inspired by various open-source projects that aim to make hardware control easier and more accessible. Special thanks to the contributors of `spidev` and Raspberry Pi for their amazing support!

---

Now, let your **Raspberry Pi 5** light up the room with **Pi5Neo**!

---

### πŸ”— Useful Links
- [Pi5Neo on PyPI](https://pypi.org/project/Pi5Neo)
- [Pi5Neo GitHub Repository](https://github.com/vanshksingh/Pi5Neo)
- [Raspberry Pi Official Website](https://www.raspberrypi.org)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vanshksingh/pi5neo",
    "name": "Pi5Neo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "raspberrypi5, neopixel, spi, led-strip, hardware",
    "author": "Vansh Kumar Singh",
    "author_email": "vsvsasas@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/45/b6/c8d24e7306d7c6e670086c7f7c2c9dd3ae596a20b82aee3ce839ced2dd7f/pi5neo-1.0.5.tar.gz",
    "platform": "Raspberry Pi 5",
    "description": "# Pi5Neo\n\n### Simplifying NeoPixel LED Control on Raspberry Pi 5 via SPI (GPIO 10)\n\n[![PyPI version](https://badge.fury.io/py/Pi5Neo.svg)](https://badge.fury.io/py/Pi5Neo) \n[![Python Versions](https://img.shields.io/pypi/pyversions/Pi5Neo.svg)](https://pypi.org/project/Pi5Neo)\n[![License](https://img.shields.io/github/license/vanshksingh/Pi5Neo)](LICENSE)\n\n![IMG_7596](https://github.com/user-attachments/assets/6fb727ae-789e-4d25-9dd7-38599fdbb81e)\n\nPi5Neo is a Python library designed to make controlling **NeoPixel LED strips** super easy and efficient on the **Raspberry Pi 5** (or equivalent boards). Whether you're creating dazzling light shows, informative displays, or ambient lighting, Pi5Neo simplifies the process using the Raspberry Pi\u2019s **SPI interface** for high-performance communication.\n\n## \ud83c\udf1f Key Features\n\n- **Easy NeoPixel Control**: Send commands to any NeoPixel LED strip connected to the Raspberry Pi 5\u2019s SPI interface.\n- **Smooth Transitions**: Enjoy vibrant color transitions with rainbow effects, loading bars, blinking patterns, and more.\n- **Optimized for Performance**: Tailored for the Raspberry Pi 5, ensuring fast and reliable communication with NeoPixel strips.\n- **Minimalistic API**: A simple API lets you focus on creativity without worrying about low-level hardware details.\n- **Flexible Configurations**: Control various effects and animations by easily setting colors, durations, and brightness levels.\n\n## \ud83d\ude80 Installation\n\nYou can install Pi5Neo via `pip`:\n\n```bash\npip install pi5neo\n```\n\n### Requirements\n- **Python 3.6+**\n- **spidev** (automatically installed with Pi5Neo)\n\n### Hardware\n- **Raspberry Pi 5** (or equivalent with SPI interface)\n- **NeoPixel LED Strip** (WS281x family)\n\n## \ud83d\udcda Usage\n\nPi5Neo makes it straightforward to set up and control your NeoPixel strip. Here's a simple example:\n\n```python\nfrom pi5neo import Pi5Neo\n\n# Initialize the Pi5Neo class with 10 LEDs and an SPI speed of 800kHz\nneo = Pi5Neo('/dev/spidev0.0', 10, 800)\n\n# Fill the strip with a red color\nneo.fill_strip(255, 0, 0)\nneo.update_strip()  # Commit changes to the LEDs\n\n# Set the 5th LED to blue\nneo.set_led_color(4, 0, 0, 255)\nneo.update_strip()\n```\n\n## \ud83c\udf08 Examples\n\nYou can find more advanced examples in the [examples](examples) directory. Here\u2019s a quick showcase of some cool effects you can create with Pi5Neo:\n\n### Example 1: Rainbow Cycle\n```python\nfrom pi5neo import Pi5Neo\nimport time\n\ndef rainbow_cycle(neo, delay=0.1):\n    colors = [\n        (255, 0, 0),  # Red\n        (255, 127, 0),  # Orange\n        (255, 255, 0),  # Yellow\n        (0, 255, 0),  # Green\n        (0, 0, 255),  # Blue\n        (75, 0, 130),  # Indigo\n        (148, 0, 211)  # Violet\n    ]\n    for color in colors:\n        neo.fill_strip(*color)\n        neo.update_strip()\n        time.sleep(delay)\n\nneo = Pi5Neo('/dev/spidev0.0', 10, 800)\nrainbow_cycle(neo)\n```\n\n### Example 2: Loading Bar Effect\n```python\nfrom pi5neo import Pi5Neo\nimport time\n\ndef loading_bar(neo):\n    for i in range(neo.num_leds):\n        neo.set_led_color(i, 0, 255, 0)  # Green loading bar\n        neo.update_strip()\n        time.sleep(0.2)\n    neo.clear_strip()\n    neo.update_strip()\n\nneo = Pi5Neo('/dev/spidev0.0', 10, 800)\nloading_bar(neo)\n```\n\n\n## \u2699\ufe0f Configuration\n\nYou can configure Pi5Neo by passing in different parameters for the number of LEDs, SPI speed, and more:\n\n```python\nPi5Neo('/dev/spidev0.0', num_leds=20, spi_speed_khz=1000)\n```\n\n- **`/dev/spidev0.0`**: SPI device path\n- **`num_leds`**: Number of LEDs in the NeoPixel strip\n- **`spi_speed_khz`**: SPI speed in kHz (default 800)\n\n## \ud83d\udee0\ufe0f Contributing\n\nWe welcome contributions from the community! To contribute:\n\n1. Fork the repo.\n2. Create a new branch (`git checkout -b my-feature`).\n3. Commit your changes (`git commit -m 'Add new feature'`).\n4. Push to the branch (`git push origin my-feature`).\n5. Create a new Pull Request.\n\nFeel free to open issues for bugs, questions, or feature requests.\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \u2764\ufe0f Acknowledgements\n\nPi5Neo was inspired by various open-source projects that aim to make hardware control easier and more accessible. Special thanks to the contributors of `spidev` and Raspberry Pi for their amazing support!\n\n---\n\nNow, let your **Raspberry Pi 5** light up the room with **Pi5Neo**!\n\n---\n\n### \ud83d\udd17 Useful Links\n- [Pi5Neo on PyPI](https://pypi.org/project/Pi5Neo)\n- [Pi5Neo GitHub Repository](https://github.com/vanshksingh/Pi5Neo)\n- [Raspberry Pi Official Website](https://www.raspberrypi.org)\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A NeoPixel LED control library for Raspberry Pi 5 using SPI",
    "version": "1.0.5",
    "project_urls": {
        "Homepage": "https://github.com/vanshksingh/pi5neo"
    },
    "split_keywords": [
        "raspberrypi5",
        " neopixel",
        " spi",
        " led-strip",
        " hardware"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3173bbcfc633d59f6c5058fbaa603fe3a76569c83727bf109ed71fe6903cc44",
                "md5": "7acf420b678f9f679d01810b3a4c3c72",
                "sha256": "1bc9ddbe83940e42df2f4068c743a66e22ccf1f8b06954796c9fe47c6ff023ed"
            },
            "downloads": -1,
            "filename": "Pi5Neo-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7acf420b678f9f679d01810b3a4c3c72",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5715,
            "upload_time": "2024-09-15T19:26:26",
            "upload_time_iso_8601": "2024-09-15T19:26:26.184459Z",
            "url": "https://files.pythonhosted.org/packages/b3/17/3bbcfc633d59f6c5058fbaa603fe3a76569c83727bf109ed71fe6903cc44/Pi5Neo-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45b6c8d24e7306d7c6e670086c7f7c2c9dd3ae596a20b82aee3ce839ced2dd7f",
                "md5": "31297110c4bf26007eced551e78ed5d7",
                "sha256": "490a8c54c769ccb1a578e81f68d301ee6af3129126bc58585e79de24f82811e2"
            },
            "downloads": -1,
            "filename": "pi5neo-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "31297110c4bf26007eced551e78ed5d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8782,
            "upload_time": "2024-09-15T19:26:27",
            "upload_time_iso_8601": "2024-09-15T19:26:27.660920Z",
            "url": "https://files.pythonhosted.org/packages/45/b6/c8d24e7306d7c6e670086c7f7c2c9dd3ae596a20b82aee3ce839ced2dd7f/pi5neo-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-15 19:26:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vanshksingh",
    "github_project": "pi5neo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pi5neo"
}
        
Elapsed time: 0.44390s