https://github.com/so-cool/neopixel-python
Python library the AdaFruit's NeoPixels
https://github.com/so-cool/neopixel-python
neopixel raspberry-pi ws281x
Last synced: about 2 months ago
JSON representation
Python library the AdaFruit's NeoPixels
- Host: GitHub
- URL: https://github.com/so-cool/neopixel-python
- Owner: So-Cool
- License: gpl-3.0
- Created: 2018-02-19T16:36:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-16T23:34:06.000Z (about 6 years ago)
- Last Synced: 2025-07-07T19:52:45.937Z (12 months ago)
- Topics: neopixel, raspberry-pi, ws281x
- Language: Python
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# NeoPixel Python #
A thread-based Python library to control WS281X LEDs (AdaFruits NeoPixels).
## Installation ##
(Dependencies are installed automatically with this method.)
```
git clone https://github.com/So-Cool/neopixel-python.git
cd neopixel-python
pip install .
```
## Dependencies ##
This library requires [`rpi_ws281x`](https://github.com/jgarff/rpi_ws281x) and its corresponding [Python library](https://github.com/rpi-ws281x/rpi-ws281x-python).
It can be installed either with `pip` (recommended) or manually -- see below.
Detailed installation instructions are available on [AdaFruit's website](https://learn.adafruit.com/neopixels-on-raspberry-pi/python-usage).
### Dependency Installation via pip ###
```
sudo pip install rpi_ws281x
```
### Manual Dependency Installation ###
If you want to install the `rpi_ws281x` library manually:
```
# Update OS packages
sudo apt-get update
sudo apt-get install build-essential python-dev git scons swig
# Install WS281X driver...
git clone https://github.com/jgarff/rpi_ws281x.git
cd rpi_ws281x
scons
# ...and the corresponding Python package
sudo pip install rpi_ws281x
# `cd python && sudo python setup.py install` has been deprecated
```
---
Test with: `rpi_ws281x/python/examples/strandtest.py`.
Adjust `LED_PIN` to 13 or 18 and `LED_CHANNEL` 0 to 1.
## Notes ##
This library is distributed with a file (`neopixel_python/neopixel.py`) adapted from the [`rpi_ws281x` library](https://github.com/jgarff/rpi_ws281x/blob/master/python/neopixel.py).
It is required for the proper functioning of this package but it is not distributed with the pip's version of `rpi_ws281x`, which superseded the Python library distributed as a part of [`rpi_ws281x`](https://github.com/jgarff/rpi_ws281x).
## To Do ##
- [ ] Consider [Unicorn Hat](https://github.com/pimoroni/unicorn-hat) as a Linux service written in C and controlled from Python instead. Also have a look at [Unicorn Paint](https://learn.pimoroni.com/tutorial/unicorn-hat/getting-started-with-unicorn-paint) and [OctaPi](https://projects.raspberrypi.org/en/projects/build-an-octapi)'s use of Unicorn Hat.