Skip to content

Commit ce4f8e3

Browse files
committed
Prep for v0.0.1
1 parent dab7870 commit ce4f8e3

3 files changed

Lines changed: 73 additions & 1 deletion

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,23 @@ Latest/development library from GitHub:
2525
* `cd apa102-python`
2626
* `sudo ./install.sh`
2727

28+
# Usage
29+
30+
The APA102 class will attempt to use spidev or RPi.GPIO depending on which pins you specify.
31+
32+
For example; three RGB LEDs connected to SPI pins 10 and 11 with chip-select 8 (CE0):
33+
34+
```python
35+
from apa102 import APA102
36+
lights = APA102(3, 10, 11, 8)
37+
```
38+
39+
You can then set individual pixels with `set_pixel`:
40+
41+
```
42+
lights.set_pixel(0, 255, 0, 0) # Pixel 1 to Red
43+
lights.set_pixel(1, 0, 255, 0) # Pixel 2 to Green
44+
lights.set_pixel(2, 0, 0, 255) # Pixel 3 to Blue
45+
```
46+
47+
Pixels are zero-indexed and accept Red, Green and Blue colour values from 0 to 255.

library/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# APA102 Library
2+
3+
[![Build Status](https://travis-ci.com/pimoroni/apa102-python.svg?branch=master)](https://travis-ci.com/pimoroni/apa102-python)
4+
[![Coverage Status](https://coveralls.io/repos/github/pimoroni/apa102-python/badge.svg?branch=master)](https://coveralls.io/github/pimoroni/apa102-python?branch=master)
5+
[![PyPi Package](https://img.shields.io/pypi/v/apa102.svg)](https://pypi.python.org/pypi/apa102)
6+
[![Python Versions](https://img.shields.io/pypi/pyversions/apa102.svg)](https://pypi.python.org/pypi/apa102)
7+
8+
# Pre-requisites
9+
10+
You must enable SPI:
11+
12+
* spi: `sudo raspi-config nonint do_spi 0`
13+
14+
You can optionally run `sudo raspi-config` or the graphical Raspberry Pi Configuration UI to enable interfaces.
15+
16+
# Installing
17+
18+
Stable library from PyPi:
19+
20+
* Just run `python3 -m pip install apa102`
21+
22+
Latest/development library from GitHub:
23+
24+
* `git clone https://github.com/pimoroni/apa102-python`
25+
* `cd apa102-python`
26+
* `sudo ./install.sh`
27+
28+
# Usage
29+
30+
The APA102 class will attempt to use spidev or RPi.GPIO depending on which pins you specify.
31+
32+
For example; three RGB LEDs connected to SPI pins 10 and 11 with chip-select 8 (CE0):
33+
34+
```python
35+
from apa102 import APA102
36+
lights = APA102(3, 10, 11, 8)
37+
```
38+
39+
You can then set individual pixels with `set_pixel`:
40+
41+
```
42+
lights.set_pixel(0, 255, 0, 0) # Pixel 1 to Red
43+
lights.set_pixel(1, 0, 255, 0) # Pixel 2 to Green
44+
lights.set_pixel(2, 0, 0, 255) # Pixel 3 to Blue
45+
```
46+
47+
Pixels are zero-indexed and accept Red, Green and Blue colour values from 0 to 255.
48+
49+
# Changelog
50+
0.0.1
51+
-----
52+
53+
* Initial Release

library/tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ deps =
2222
check-manifest
2323
flake8
2424
twine
25-

0 commit comments

Comments
 (0)