Documentation
¶
Overview ¶
Package ws2801 uses periph to access ws2801 LED strips via SPI
This package uses the SPI interface provioded by periph to control a ws2801 LED strip.
Index ¶
- type Pixels
- func (p *Pixels) ClearPixel(Position int) error
- func (p *Pixels) ClearPixels(Start int, End int) error
- func (p *Pixels) Close()
- func (p *Pixels) Count() int
- func (p *Pixels) SetPixel(Position int, Red byte, Green byte, Blue byte) error
- func (p *Pixels) SetPixels(Start int, End int, Red byte, Green byte, Blue byte) error
- func (p *Pixels) Show() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pixels ¶
type Pixels struct {
// contains filtered or unexported fields
}
The Pixels object is the interface to the LED strip.
func NewPixels ¶
NewPixels creates a new Pixels object.
NumLEDs is the total number of LEDs in the strip.
func (*Pixels) ClearPixel ¶
ClearPixel sets the color of a pixel to black.
Position is the number of the pixel starting with 0.
func (*Pixels) ClearPixels ¶
ClearPixels sets the color of a range of pixels.
Start is the position of the first pixel to set. End is the position of the last pixel to set. Red specifies the intensity of the red subpixels. It ranges between 0 and 255. Green specifies the intensity of the green subpixels. It ranges between 0 and 255. Blue specifies the intensity of the blue subpixels. It ranges between 0 and 255.
func (*Pixels) Close ¶
func (p *Pixels) Close()
Close closes the Pixels object and the SPI connection.
func (*Pixels) SetPixel ¶
SetPixel sets the color of a pixel.
Position is the number of the pixel starting with 0. Red specifies the intensity of the red subpixel. It ranges between 0 and 255. Green specifies the intensity of the green subpixel. It ranges between 0 and 255. Blue specifies the intensity of the blue subpixel. It ranges between 0 and 255.
func (*Pixels) SetPixels ¶
SetPixels sets the color of a range of pixels.
Start is the position of the first pixel to set. End is the position of the last pixel to set. Red specifies the intensity of the red subpixels. It ranges between 0 and 255. Green specifies the intensity of the green subpixels. It ranges between 0 and 255. Blue specifies the intensity of the blue subpixels. It ranges between 0 and 255.