Skip to content

Commit 7b3a6ae

Browse files
author
Kevin J Walters
committed
Adding notes to README.rst from the cookiecutter file - includes example code for 25 string led.
1 parent 0a4d3ba commit 7b3a6ae

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

README.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ Introduction
1313
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_WS2801
1414
:alt: Build Status
1515

16-
.. todo:: Describe what the library does.
16+
Higher level WS2801 driver that presents the LED string as a sequence.
17+
It is the same api as the
18+
`NeoPixel library <https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel>`_.
19+
20+
Colors are stored as tuples by default. However, you can also use int hex syntax
21+
to set values similar to colors on the web. For example, ``0x800000`` (``#800000``
22+
on the web) is equivalent to ``(0x80, 0, 0)``.
1723

1824
Dependencies
1925
=============
@@ -29,7 +35,17 @@ This is easily achieved by downloading
2935
Usage Example
3036
=============
3137

32-
.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
38+
This example demonstrates the library driving
39+
`a strand of 25 RGB leds <https://www.adafruit.com/product/322>`_ by a
40+
`Gemma M0 <https://www.adafruit.com/product/3501>`_ using the hardware SPI capable outputs.
41+
42+
.. code-block:: python
43+
44+
import board
45+
import adafruit_ws2801
46+
47+
leds = adafruit_ws2801.WS2801(board.D2, board.D0, 25)
48+
leds.fill((0x80, 0, 0))
3349
3450
Contributing
3551
============

0 commit comments

Comments
 (0)