pixarray

package
v0.0.0-...-98f2a0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	GRB = iota
	BRG
	BGR
	GBR
	RGB
	RBG
)
View Source
const (
	SYMBOL_HIGH = 0x6 // 1 1 0
	SYMBOL_LOW  = 0x4 // 1 0 0
)
View Source
const (
	LED_RESET_US = 55
)

Variables

View Source
var StringOrders map[string]int = map[string]int{
	"GRB": GRB,
	"BRG": BRG,
	"BGR": BGR,
	"GBR": GBR,
	"RGB": RGB,
	"RBG": RBG,
}

Functions

This section is empty.

Types

type LEDStrip

type LEDStrip interface {
	RPi() *rpi.RPi
	MaxPerChannel() int
	GetPixel(i int) Pixel
	SetPixel(i int, p Pixel)
	Write() error
}

func NewLPD8806

func NewLPD8806(dev dev, numPixels int, numColors int, spiSpeed uint32, order int) (LEDStrip, error)

func NewWS281x

func NewWS281x(numPixels int, numColors int, order int, freq uint, dma int, pins []int) (LEDStrip, error)

type LPD8806

type LPD8806 struct {
	// contains filtered or unexported fields
}

func (*LPD8806) GetPixel

func (la *LPD8806) GetPixel(i int) Pixel

func (*LPD8806) MaxPerChannel

func (la *LPD8806) MaxPerChannel() int

func (*LPD8806) RPi

func (la *LPD8806) RPi() *rpi.RPi

func (*LPD8806) SetPixel

func (la *LPD8806) SetPixel(i int, p Pixel)

func (*LPD8806) Write

func (la *LPD8806) Write() error

type PixArray

type PixArray struct {
	// contains filtered or unexported fields
}

func NewPixArray

func NewPixArray(numPixels int, numColors int, leds LEDStrip) *PixArray

func (*PixArray) GetPixel

func (pa *PixArray) GetPixel(i int) Pixel

func (*PixArray) GetPixels

func (pa *PixArray) GetPixels() []Pixel

func (*PixArray) MaxPerChannel

func (pa *PixArray) MaxPerChannel() int

func (*PixArray) NumColors

func (pa *PixArray) NumColors() int

func (*PixArray) NumPixels

func (pa *PixArray) NumPixels() int

func (*PixArray) RPi

func (pa *PixArray) RPi() *rpi.RPi

func (*PixArray) SetAll

func (pa *PixArray) SetAll(p Pixel)

func (*PixArray) SetAlternate

func (pa *PixArray) SetAlternate(num int, div int, p1 Pixel, p2 Pixel)

func (*PixArray) SetOne

func (pa *PixArray) SetOne(i int, p Pixel)

func (*PixArray) SetPerChanAlternate

func (pa *PixArray) SetPerChanAlternate(num Pixel, div int, p1 Pixel, p2 Pixel)

func (*PixArray) Write

func (pa *PixArray) Write() error

type Pixel

type Pixel struct {
	R int
	G int
	B int
	W int
}

func (*Pixel) String

func (p *Pixel) String() string

type WS281x

type WS281x struct {
	// contains filtered or unexported fields
}

func (*WS281x) GetPixel

func (ws *WS281x) GetPixel(i int) Pixel

func (*WS281x) MaxPerChannel

func (ws *WS281x) MaxPerChannel() int

func (*WS281x) RPi

func (ws *WS281x) RPi() *rpi.RPi

func (*WS281x) SetPixel

func (ws *WS281x) SetPixel(i int, p Pixel)

func (*WS281x) Write

func (ws *WS281x) Write() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL