addressable

package
v0.0.0-...-c730260 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LightsToColors

func LightsToColors(lights []*Light) []color.Color

Types

type Aspect

type Aspect float64

Aspect is an alias for float64 to clarify Direction of LEDs in an Arc. Given in terms of radians.

const (
	// AspectDownward indicates that LEDs on an Arc are facing downward
	AspectDownward Aspect = 0
	// AspectOutward indicates that LEDs on an Arc are facing outward
	AspectOutward Aspect = 0.5
	// AspectUpward indicates that LEDs on an Arc are facing upward
	AspectUpward Aspect = 1.0
	// AspectInward indicates that LEDs on an Arc are facing inward
	AspectInward Aspect = 1.5
)

type Exchanger

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

func NewExchanger

func NewExchanger() Exchanger

func (Exchanger) Receive

func (e Exchanger) Receive(t time.Time) *Instruction

func (Exchanger) Send

func (e Exchanger) Send(instruct Instruction) error

type Instruction

type Instruction struct {
	Time   time.Time
	Colors []color.Color
}

func (Instruction) GetTime

func (i Instruction) GetTime() time.Time

type Instructions

type Instructions struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

Instructions is an set of Instructions which are ordered by their Time

func NewInstructions

func NewInstructions() Instructions

NewInstructions initializes and returns a Instructions

func (Instructions) Add

func (p Instructions) Add(c Instruction)

Add inserts a Instruction into a Instructions

func (Instructions) Advance

func (p Instructions) Advance(t time.Time) *Instruction

Advance drops all Instructions before t and returns the most recent Instruction

type Light

type Light struct {
	Color        color.Color
	Position     int
	NumPositions int
	*space.Object
}

Basic represents a NeoPixel Light in a line

func (Light) GetColor

func (l Light) GetColor() color.Color

GetColor returns the color of the light

func (Light) GetPosition

func (l Light) GetPosition() (int, int)

GetPosition returns the position of the Light (in a string)

func (*Light) SetColor

func (l *Light) SetColor(newColor color.Color)

SetColor changes the color of the light

type Receiver

type Receiver interface {
	Receive(time.Time) *Instruction
}

type Sender

type Sender interface {
	Send(Instruction) error
}

type Spacing

type Spacing float64

Spacing is an alias for floats to encourage/support common LED densities of a strip

const (
	// Spacing30 is the spacing of LEDs on a strip which has 30 LEDs per meter
	Spacing30 Spacing = 1.0 / 30.0
	// Spacing60 is the spacing of LEDs on a strip which has 60 LEDs per meter
	Spacing60 Spacing = 1.0 / 60.0
	// Spacing120 is the spacing of LEDs on a strip which has 120 LEDs per meter
	Spacing120 Spacing = 1.0 / 120.0
	// Spacing144 is the spacing of LEDs on a strip which has 144 LEDs per meter
	Spacing144 Spacing = 1.0 / 144.0
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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