complete the documentation

This commit is contained in:
Jeff Epler 2022-11-04 13:26:15 -05:00
parent 5d783aac86
commit 5f3cbbb65f
No known key found for this signature in database
GPG key ID: D5BF15AB975AB4DE
6 changed files with 36 additions and 45 deletions

View file

@ -29,6 +29,7 @@ Dependencies
This driver depends on: This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_ * `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. Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading This is easily achieved by downloading
@ -36,40 +37,6 @@ This is easily achieved by downloading
or individual libraries can be installed using or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_. `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 Installing to a Connected CircuitPython Device with Circup
========================================================== ==========================================================
@ -96,8 +63,33 @@ Or the following command to update an existing version:
Usage Example Usage Example
============= =============
.. todo:: Add a quick, simple example. It and other examples should live in the 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:
examples folder and be included in docs/examples.rst.
.. 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 Documentation
============= =============

View file

@ -15,7 +15,7 @@
import adafruit_pioasm import adafruit_pioasm
import bitops import bitops
import _pixelbuf import adafruit_pixelbuf
import rp2pio import rp2pio
_PROGRAM = """ _PROGRAM = """
@ -44,7 +44,7 @@ GRBW = "GRBW"
"""Green Red Blue White""" """Green Red Blue White"""
class NeoPxl8(_pixelbuf.PixelBuf): class NeoPxl8(adafruit_pixelbuf.PixelBuf):
""" """
A sequence of neopixels. A sequence of neopixels.

View file

@ -26,7 +26,7 @@ extensions = [
# Uncomment the below if you use native CircuitPython modules such as # Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the # digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning. # autodoc module docs will fail to generate with a warning.
# autodoc_mock_imports = ["digitalio", "busio"] autodoc_mock_imports = ["bitops", "rp2pio"]
intersphinx_mapping = { intersphinx_mapping = {

View file

@ -24,14 +24,12 @@ Table of Contents
.. toctree:: .. toctree::
:caption: Tutorials :caption: Tutorials
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave Adafruit NeoPixel Überguide <https://learn.adafruit.com/adafruit-neopixel-uberguide>
the toctree above for use later.
.. toctree:: .. toctree::
:caption: Related Products :caption: Related Products
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave All NeoPixels in the adafruit shop <https://www.adafruit.com/category/168>
the toctree above for use later.
.. toctree:: .. toctree::
:caption: Other Links :caption: Other Links

View file

@ -15,8 +15,8 @@ num_pixels = num_strands * strand_length
# Make the object to control the pixels # Make the object to control the pixels
pixels = NeoPxl8( pixels = NeoPxl8(
board.GP0, first_led_pin,
num_strands * strand_length, num_pixels,
num_strands=num_strands, num_strands=num_strands,
auto_write=False, auto_write=False,
brightness=1.00, brightness=1.00,

View file

@ -5,3 +5,4 @@
Adafruit-Blinka Adafruit-Blinka
Adafruit-CircuitPython-pioasm Adafruit-CircuitPython-pioasm
Adafruit-CircuitPython-PixelBuf