jacdac.led_strip

Submodules

Package Contents

Classes

LedStripClient

A controller for strips of individually controlled RGB LEDs.

class jacdac.led_strip.LedStripClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

A controller for strips of individually controlled RGB LEDs. Implements a client for the LED Strip service.

property brightness: float | None

Set the luminosity of the strip. At 0 the power to the strip is completely shut down., _: /

property actual_brightness: float | None

This is the luminosity actually applied to the strip. May be lower than brightness if power-limited by the max_power register. It will rise slowly (few seconds) back to brightness is limits are no longer required., _: /

property light_type: jacdac.led_strip.constants.LedStripLightType | None

Specifies the type of light strip connected to controller. Controllers which are sold with lights should default to the correct type and could not allow change.,

property num_pixels: int | None

Specifies the number of pixels in the strip. Controllers which are sold with lights should default to the correct length and could not allow change. Increasing length at runtime leads to ineffective use of memory and may lead to controller reboot., _: #

property num_columns: int | None

(Optional) If the LED pixel strip is a matrix, specifies the number of columns. Otherwise, a square shape is assumed. Controllers which are sold with lights should default to the correct length and could not allow change. Increasing length at runtime leads to ineffective use of memory and may lead to controller reboot., _: #

property max_power: int | None

Limit the power drawn by the light-strip (and controller)., _: mA

property max_pixels: int | None

The maximum supported number of pixels. All writes to num_pixels are clamped to max_pixels., _: #

property num_repeats: int | None

How many times to repeat the program passed in run command. Should be set before the run command. Setting to 0 means to repeat forever., _: #

property variant: jacdac.led_strip.constants.LedStripVariant | None

(Optional) Specifies the shape of the light strip.,

run(program: bytes) None

Run the given light “program”. See service description for details.