complete the documentation
This commit is contained in:
parent
5d783aac86
commit
5f3cbbb65f
6 changed files with 36 additions and 45 deletions
64
README.rst
64
README.rst
|
|
@ -29,6 +29,7 @@ Dependencies
|
|||
This driver depends on:
|
||||
|
||||
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
|
||||
* `pioasm <https://github.com/adafruit/Adafruit_CircuitPython_pioasm>`_
|
||||
|
||||
Please ensure all dependencies are available on the CircuitPython filesystem.
|
||||
This is easily achieved by downloading
|
||||
|
|
@ -36,40 +37,6 @@ This is easily achieved by downloading
|
|||
or individual libraries can be installed using
|
||||
`circup <https://github.com/adafruit/circup>`_.
|
||||
|
||||
.. todo:: Describe the Adafruit product this library works with. For PCBs, you can also add the
|
||||
image from the assets folder in the PCB's GitHub repo.
|
||||
|
||||
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/>`_
|
||||
Installing from PyPI
|
||||
=====================
|
||||
.. note:: This library is not available on PyPI yet. Install documentation is included
|
||||
as a standard element. Stay tuned for PyPI availability!
|
||||
|
||||
.. todo:: Remove the above note if PyPI version is/will be available at time of release.
|
||||
|
||||
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
|
||||
PyPI <https://pypi.org/project/adafruit-circuitpython-neopxl8/>`_.
|
||||
To install for current user:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
pip3 install adafruit-circuitpython-neopxl8
|
||||
|
||||
To install system-wide (this may be required in some cases):
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
sudo pip3 install adafruit-circuitpython-neopxl8
|
||||
|
||||
To install in a virtual environment in your current project:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
mkdir project-name && cd project-name
|
||||
python3 -m venv .venv
|
||||
source .env/bin/activate
|
||||
pip3 install adafruit-circuitpython-neopxl8
|
||||
|
||||
Installing to a Connected CircuitPython Device with Circup
|
||||
==========================================================
|
||||
|
||||
|
|
@ -96,8 +63,33 @@ Or the following command to update an existing version:
|
|||
Usage Example
|
||||
=============
|
||||
|
||||
.. todo:: Add a quick, simple example. It and other examples should live in the
|
||||
examples folder and be included in docs/examples.rst.
|
||||
See the `Examples page <examples.html>`_ for a full example. This example shows how to set up 8 30-pixel LED strands on an Adafruit Feather Scorpio RP2040 and set them all to dim red:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import time
|
||||
import board
|
||||
from adafruit_neopxl8 import NeoPxl8
|
||||
|
||||
# Customize for your strands here
|
||||
num_strands = 8
|
||||
strand_length = 30
|
||||
first_led_pin = board.NEOPIXEL0
|
||||
|
||||
num_pixels = num_strands * strand_length
|
||||
|
||||
# Make the object to control the pixels
|
||||
pixels = NeoPxl8(
|
||||
first_led_pin,
|
||||
num_pixels,
|
||||
num_strands=num_strands,
|
||||
)
|
||||
|
||||
pixels.fill(0x01_00_00)
|
||||
|
||||
while True:
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
import adafruit_pioasm
|
||||
import bitops
|
||||
import _pixelbuf
|
||||
import adafruit_pixelbuf
|
||||
import rp2pio
|
||||
|
||||
_PROGRAM = """
|
||||
|
|
@ -44,7 +44,7 @@ GRBW = "GRBW"
|
|||
"""Green Red Blue White"""
|
||||
|
||||
|
||||
class NeoPxl8(_pixelbuf.PixelBuf):
|
||||
class NeoPxl8(adafruit_pixelbuf.PixelBuf):
|
||||
"""
|
||||
A sequence of neopixels.
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ extensions = [
|
|||
# Uncomment the below if you use native CircuitPython modules such as
|
||||
# digitalio, micropython and busio. List the modules you use. Without it, the
|
||||
# autodoc module docs will fail to generate with a warning.
|
||||
# autodoc_mock_imports = ["digitalio", "busio"]
|
||||
autodoc_mock_imports = ["bitops", "rp2pio"]
|
||||
|
||||
|
||||
intersphinx_mapping = {
|
||||
|
|
|
|||
|
|
@ -24,14 +24,12 @@ Table of Contents
|
|||
.. toctree::
|
||||
:caption: Tutorials
|
||||
|
||||
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
|
||||
the toctree above for use later.
|
||||
Adafruit NeoPixel Überguide <https://learn.adafruit.com/adafruit-neopixel-uberguide>
|
||||
|
||||
.. toctree::
|
||||
:caption: Related Products
|
||||
|
||||
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
|
||||
the toctree above for use later.
|
||||
All NeoPixels in the adafruit shop <https://www.adafruit.com/category/168>
|
||||
|
||||
.. toctree::
|
||||
:caption: Other Links
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ num_pixels = num_strands * strand_length
|
|||
|
||||
# Make the object to control the pixels
|
||||
pixels = NeoPxl8(
|
||||
board.GP0,
|
||||
num_strands * strand_length,
|
||||
first_led_pin,
|
||||
num_pixels,
|
||||
num_strands=num_strands,
|
||||
auto_write=False,
|
||||
brightness=1.00,
|
||||
|
|
|
|||
|
|
@ -5,3 +5,4 @@
|
|||
|
||||
Adafruit-Blinka
|
||||
Adafruit-CircuitPython-pioasm
|
||||
Adafruit-CircuitPython-PixelBuf
|
||||
|
|
|
|||
Loading…
Reference in a new issue