neopixel -- Control of WS2812 / NeoPixel LEDs. ============================================== .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/neopixel/__init__.pyi .. py:module:: neopixel .. autoapi-nested-parse:: Control of WS2812 / NeoPixel LEDs. This module provides a driver for WS2818 / NeoPixel LEDs. .. note:: This module is only included by default on the ESP8266, ESP32 and RP2 ports. On STM32 / Pyboard and others, you can either install the ``neopixel`` package using :term:`mip`, or you can download the module directly from :term:`micropython-lib` and copy it to the filesystem. Classes ------- .. autoapisummary:: neopixel.NeoPixel Module Contents --------------- .. py:class:: NeoPixel(pin, n, *, bpp=3, timing=1) Construct an NeoPixel object. The parameters are: - *pin* is a machine.Pin instance. - *n* is the number of LEDs in the strip. - *bpp* is 3 for RGB LEDs, and 4 for RGBW LEDs. - *timing* is 0 for 400KHz, and 1 for 800kHz LEDs (most are 800kHz). .. py:method:: __getitem__(index) -> Tuple Returns the pixel at *index* as an RGB/RGBW tuple. .. py:method:: __len__() -> int Returns the number of LEDs in the strip. .. py:method:: __setitem__(index, val) -> None Set the pixel at *index* to the value, which is an RGB/RGBW tuple. .. py:method:: fill(pixel) -> None Sets the value of all pixels to the specified *pixel* value (i.e. an RGB/RGBW tuple). .. py:method:: write() -> None Writes the current pixel data to the strip.