Skip to main content

pymcu-lib-neopixel

WS2812 / NeoPixel addressable LED strips for PyMCU — compiled to native machine code, with no interpreter on the chip.

pymcu install neopixel

The same strip, three APIs

Which one you get depends on the stdlib layer your project declares. The import is always neopixel.

Native (stdlib unset):

from neopixel import NeoPixel

strip = NeoPixel("PD6", 8)
strip[0] = (255, 0, 0)
strip.show()

MicroPython (stdlib = ["micropython"]) — a MicroPython script, unchanged:

from machine import Pin
from neopixel import NeoPixel

np = NeoPixel(Pin(6), 8)
np[0] = (255, 0, 0)
np.write()

CircuitPython (stdlib = ["circuitpython"]) — a CircuitPython script, unchanged:

import board
import neopixel

pixels = neopixel.NeoPixel(board.D6, 8, auto_write=False)
pixels.fill((0, 32, 0))
pixels.show()

None of those three files contains a single conditional: the layer adapters are plain Python written against each API as it is documented upstream. Everything that has to know about a chip lives in one private module, _neopixel.core, and the compiler folds it away.

Cost

Colours live in a per-strip SRAM framebuffer, 3 bytes per pixel in WS2812 wire order — 24 bytes for a strip of 8, and nothing else. Every method is @inline, so no object is allocated on the device and no method call survives compilation.

Measured figures per chip are published in the library index, and the flash cost of every example in this repo is in docs/Getting-started.md.

Supported hardware

WS2812 / WS2812B / NeoPixel strips on AVR (ATmega328P and friends) at 16 MHz, on pins PB0-PB5 and PD2-PD7. show() / write() disables interrupts for the duration of the transmission and restores them afterwards, since WS2812 bit timing has no clock line to resynchronize against — see docs/How-it-works.md.

Bit timing (750 ns / 437.5 ns high pulses, inside both the WS2812 and WS2812B datasheet windows) is verified by tests/test_timing.py, which compiles a probe program and measures it cycle-by-cycle on the avr8sharp AVR emulator — not yet verified against a real strip on a logic analyzer. One pin, PB0, is not yet covered by this fix and should be avoided until it is. See docs/How-it-works.md for the measured numbers, the PB0 gap, and how the numbers were obtained.

Other architectures raise a compile-time error rather than returning something that looks like it worked. Ports are welcome: _neopixel/avr.py is the whole contract — see docs/Porting-to-a-new-architecture.md.

Examples

Five complete, buildable PyMCU projects live under examples/: the native, MicroPython and CircuitPython APIs doing the same fill-and-blink, plus a per-pixel colour wipe and an auto_write demo. See docs/Getting-started.md for how to build them and their measured flash cost.

Documentation

License

MIT.

Metadata

Release files for pymcu-lib-neopixel 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymcu-lib-neopixel 0.2.0
File Size Uploaded Provenance
pymcu_lib_neopixel-0.2.0.tar.gz 28.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pymcu-lib-neopixel 0.2.0
File Interpreter ABI Platform
pymcu_lib_neopixel-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.1 kB

Release files / pymcu_lib_neopixel-0.2.0.tar.gz

Download URL pymcu_lib_neopixel-0.2.0.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
27915ca58e64a7933034365e6b661da8a7852316e5731fcd670efacbfdb84ee4
BLAKE2b-256 checksum
How to use checksums
bfe5897eb26b31eaea704ae8e81b66ae054cd188ccc9ec8aed28cff82e8b748b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / pymcu_lib_neopixel-0.2.0-py3-none-any.whl

Download URL pymcu_lib_neopixel-0.2.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83229585d8e8bc56be06b5d11349102453c49f42146e1a22ab675b44956e0d1e
BLAKE2b-256 checksum
How to use checksums
1ab7373c66de201936dfa6565d1995698e233a48a66ce776a5910cdcf3b9e9de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Security for pymcu-lib-neopixel 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pymcu_lib_neopixel-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page