Skip to content

Commit 342183f

Browse files
committed
removed incorrect dependencies
1 parent 6821b58 commit 342183f

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

README.rst

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ Introduction
1313
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_pixie
1414
:alt: Build Status
1515

16-
.. todo:: Describe what the library does.
16+
.. A driver for Pixie - 3W Chainable Smart LED Pixel
1717
1818
Dependencies
1919
=============
2020
This driver depends on:
2121

2222
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
23-
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
24-
* `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_
2523

2624
Please ensure all dependencies are available on the CircuitPython filesystem.
2725
This is easily achieved by downloading
@@ -30,7 +28,38 @@ This is easily achieved by downloading
3028
Usage Example
3129
=============
3230

33-
.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
31+
.. code-block:: python
32+
33+
import time
34+
import board
35+
import adafruit_pixie
36+
import busio
37+
38+
uart = busio.UART(board.TX, rx=None, baudrate=115200)
39+
40+
num_pixies = 2 # Change this to the number of Pixies LEDs you have.
41+
pixies = adafruit_pixie.Pixie(uart, num_pixies, brightness=0.2, auto_write=False)
42+
43+
44+
def wheel(pos):
45+
# Input a value 0 to 255 to get a color value.
46+
# The colours are a transition r - g - b - back to r.
47+
if pos < 0 or pos > 255:
48+
return 0, 0, 0
49+
if pos < 85:
50+
return int(255 - pos * 3), int(pos * 3), 0
51+
if pos < 170:
52+
pos -= 85
53+
return 0, int(255 - pos * 3), int(pos * 3)
54+
pos -= 170
55+
return int(pos * 3), 0, int(255 - (pos * 3))
56+
57+
58+
while True:
59+
for i in range(255):
60+
for pixie in range(num_pixies):
61+
pixies[pixie] = wheel(i)
62+
pixies.show()
3463
3564
Contributing
3665
============

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
adafruit-circuitpython-busdevice
2-
adafruit-circuitpython-register

0 commit comments

Comments
 (0)