adafruit_tm1814 - TM1814 LED strip driver for RP2 microcontrollers

  • Author(s): Jeff Epler for Adafruit Industries

The class defined here is largely compatible with the standard NeoPixel class, except that it always is writing data to the LEDs in the background.

Not only do TM1814 pixels require continuous updating, writing the LED data in the background will allow more time for your Python code to run.

Because the pixelbuf storage is also being written out ‘live’, it is possible to experience tearing, where the LEDs are a combination of old and new values at the same time.

class adafruit_tm1814.TM1814PixelBackground(pin, n: int, *, brightness: float = 1.0, pixel_order: str = 'WRGB', current_control: float | tuple[float, float, float, float] = TM1814_MIN_CURRENT, inverted: bool = False)

A sequence of TM1814 addressable pixels

Except as noted, provides all the functionality of adafruit_pixelbuf.PixelBuf, particularly adafruit_pixelbuf.PixelBuf.fill and adafruit_pixelbuf.PixelBuf.__setitem__.

As the strip always auto-written, there is no need to call the show method.

Parameters:
  • pin (Pin) – The pin to output neopixel data on.

  • n (int) – The number of neopixels in the chain

  • brightness (float) – Brightness of the pixels between 0.0 and 1.0 where 1.0 is full brightness. This brightness value is software-multiplied with raw pixel values.

  • current_control (float|tuple[float,float,float]) – TM1814 current control register. See documentation of the current_control property below.

  • pixel_order (str) – Set the pixel color channel order. WRGB is set by default. Only 4-bytes-per-pixel formats are supported.

  • inverted (bool) – True to invert the polarity of the output signal.

property auto_write: bool

Returns True because the strip is always auto-written.

Any value assigned to auto_write is ignored.

property current_control: float | tuple[float, float, float, float]

Access the current control register of the TM1814

The TM1814 has a per-channel current control register that is shared across the entire strip.

The current regulation range is from 6.5mA to 38mA in 0.5mA increments. Out of range values will throw ValueError.

The relationship between human perception & LED current value is highly nonlinear: The lowest setting may appear only slightly less bright than the brightest setting, not 6x brighter as you might expect.

If this property is set to a single number, then the same value is used for each channel. Otherwise, it must be a tuple of 4 elements where each element is applied to a different channel.

deinit() None

Deinitialize the object

show() None

Does nothing, because the strip is always auto-written