diff --git a/README.rst b/README.rst index 076bbdc..09b5e8b 100644 --- a/README.rst +++ b/README.rst @@ -29,6 +29,7 @@ Dependencies This driver depends on: * `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 `_. -.. 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 `_ -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 `_. -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 `_ 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 ============= diff --git a/adafruit_neopxl8.py b/adafruit_neopxl8.py index 06d7284..4f082ce 100644 --- a/adafruit_neopxl8.py +++ b/adafruit_neopxl8.py @@ -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. diff --git a/docs/conf.py b/docs/conf.py index fe717ac..3cca861 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 = { diff --git a/docs/index.rst b/docs/index.rst index 1158b26..50d51b1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 .. 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 .. toctree:: :caption: Other Links diff --git a/examples/neopxl8_simpletest.py b/examples/neopxl8_simpletest.py index 8419561..5432e0a 100644 --- a/examples/neopxl8_simpletest.py +++ b/examples/neopxl8_simpletest.py @@ -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, diff --git a/requirements.txt b/requirements.txt index f0b32a2..6313865 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ Adafruit-Blinka Adafruit-CircuitPython-pioasm +Adafruit-CircuitPython-PixelBuf