LEDStrip - adammhaile/ae45LhX89i GitHub Wiki

class bibliopixel.LEDStrip

LEDStrip provides methods to control a single, 1-dimensional LED strip. It inherits from LEDBase and provides all of its public methods and properties. LEDStrip actually lives at bibliopixel.led.LEDStrip but can be accessed at bibiliopixel.LEDStrip for convenience.

__init__(driver)

  • driver - A driver class that inherits from bibliopixel.drivers.DriverBase. See the Drivers page for more info.

set(pixel, color)

  • pixel - Integer index of pixel in the buffer array.
  • color - RGB tuple, (r,g,b), representing the color to set.

Set value of pixel to given color.

get(pixel)

  • pixel - Integer index of pixel in the buffer array.

Returns RGB tuple, (r,g,b), if pixel is in bounds. Otherwise returns (0,0,0).

fill(color, start=0, end=-1)

  • color - RGB tuple, (r,g,b), representing the color to fill.
  • start - Index of the pixel where the fill should start.
  • end - Index of the pixel where the fill should stop. Defaults to lastIndex.

Sets all pixels to given color from start index to end index. By default sets every pixel on the strip.

fillRGB(r, g, b, start=0, end=-1)

  • r - 8-bit (0-255) Red color component.
  • g - 8-bit (0-255) Green color component.
  • b - 8-bit (0-255) Blue color component.
  • start - Index of the pixel where the fill should start.
  • end - Index of the pixel where the fill should stop. Defaults to lastIndex.

Convenience method for setting color with individual components instead of RGB tuple. By default, fill() sets the given color to every pixel on the strip.

fillHSV(hsv, start=0, end=-1)

  • hsv - 8-bit HSV tuple (h,s,v)
  • start - Index of the pixel where the fill should start.
  • end - Index of the pixel where the fill should stop. Defaults to lastIndex.

Convenience method for setting color with an 8-bit HSV tuple value. By default, fill() sets the given color to every pixel on the strip.