Skip to content

Documentation for strip

luxcena_neo.strip.Strip

Class representing a led-strip,

If you are using the NeoBehaviour runtime, an pre-configured instance of this will be setup in your module with the name strip.

Attributes:

Name Type Description
SEGMENTS list[int]

A list of the configured segments.

brightness writable property

The current brightness.

power_on writable property

Wether the power action is on or not.

blank(auto_show=True)

Will turn off all pixels.

Parameters:

Name Type Description Default
auto_show bool

If set to true, strip.show() is called. Disable this if needed for some quicker animations.

True

get_pixel_color(n)

Get the 24-bit RGB color value for the LED at position n.

get_pixels()

Return an object which allows access to the LED display data as if it were a sequence of 24-bit RGB values.

num_pixels()

Return the number of pixels in the display.

set_pixel_color(n, *color)

Set the color of the LED at position N.

Parameters:

Name Type Description Default
n int

The pixel to set.

required
*color

This will be interpreted as a color.

()

set_pixel_color_XY(x, y, *color)

Set the color of a LED at position (x, y) in the matrix you have configured to a color.

Note: This will only print a warning message if you try to set pixels outside the matrix.

Parameters:

Name Type Description Default
x int

The x position.

required
y int

The y position.

required
*color

This will be interpreted as a color.

()

set_segment_color(segment, *color)

Set a whole segment to the provided color.

Parameters:

Name Type Description Default
segment int

The segment to set.

required
*color

This will be interpreted as a color.

()

set_strip_color(*color)

Set all pixels in the strip to a color

Parameters:

Name Type Description Default
*color

This will be interpreted as a color.

()

show()

Update the display with the data from the LED buffer, you can think of it as a flush method.


A note on colors

Most methods which need colors takes a *color parameter. This is because it interprets multiple types of colors. The example below illustrates this, each of the lines has the exact same effect on the led strip.

set_pixel_color(0, "#fafafa")
set_pixel_color(0, 16448250)
set_pixel_color(0, 250, 250, 250)
set_pixel_color(0, (250, 250, 250))