/ README.rst
README.rst
1 Introduction 2 ============ 3 4 5 .. image:: https://readthedocs.org/projects/adafruit-circuitpython-neopxl8/badge/?version=latest 6 :target: https://docs.circuitpython.org/projects/neopxl8/en/latest/ 7 :alt: Documentation Status 8 9 10 .. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg 11 :target: https://adafru.it/discord 12 :alt: Discord 13 14 15 .. image:: https://github.com/adafruit/Adafruit_CircuitPython_neopxl8/workflows/Build%20CI/badge.svg 16 :target: https://github.com/adafruit/Adafruit_CircuitPython_neopxl8/actions 17 :alt: Build Status 18 19 20 .. image:: https://img.shields.io/badge/code%20style-black-000000.svg 21 :target: https://github.com/psf/black 22 :alt: Code Style: Black 23 24 PIO-driven 8-way concurrent NeoPixel driver for RP2040 25 26 27 Dependencies 28 ============= 29 This driver depends on: 30 31 * `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_ 32 * `pioasm <https://github.com/adafruit/Adafruit_CircuitPython_pioasm>`_ 33 34 Please ensure all dependencies are available on the CircuitPython filesystem. 35 This is easily achieved by downloading 36 `the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_ 37 or individual libraries can be installed using 38 `circup <https://github.com/adafruit/circup>`_. 39 40 Installing to a Connected CircuitPython Device with Circup 41 ========================================================== 42 43 Make sure that you have ``circup`` installed in your Python environment. 44 Install it with the following command if necessary: 45 46 .. code-block:: shell 47 48 pip3 install circup 49 50 With ``circup`` installed and your CircuitPython device connected use the 51 following command to install: 52 53 .. code-block:: shell 54 55 circup install neopxl8 56 57 Or the following command to update an existing version: 58 59 .. code-block:: shell 60 61 circup update 62 63 Usage Example 64 ============= 65 66 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: 67 68 .. code-block:: python 69 70 import time 71 import board 72 from adafruit_neopxl8 import NeoPxl8 73 74 # Customize for your strands here 75 num_strands = 8 76 strand_length = 30 77 first_led_pin = board.NEOPIXEL0 78 79 num_pixels = num_strands * strand_length 80 81 # Make the object to control the pixels 82 pixels = NeoPxl8( 83 first_led_pin, 84 num_pixels, 85 num_strands=num_strands, 86 ) 87 88 pixels.fill(0x01_00_00) 89 90 while True: 91 time.sleep(1) 92 93 94 Documentation 95 ============= 96 API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/neopxl8/en/latest/>`_. 97 98 For information on building library documentation, please check out 99 `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_. 100 101 Contributing 102 ============ 103 104 Contributions are welcome! Please read our `Code of Conduct 105 <https://github.com/adafruit/Adafruit_CircuitPython_neopxl8/blob/HEAD/CODE_OF_CONDUCT.md>`_ 106 before contributing to help this project stay welcoming.