neopixel

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LEDArray

type LEDArray struct {
	WS            wsEngine
	MaxBrightness int
	MinBrightness int
	Brightness    int
	Color         colorful.Color
	FadeDuration  int

	Logger *zap.SugaredLogger
}

LEDArray is a struct for interacting with LEDs

func NewLEDArray

func NewLEDArray(minBrightness int, maxBrightness, ledCount int, fadeDuration int, logger *zap.SugaredLogger) (*LEDArray, error)

NewLEDArray creates a new array and initializes it

func (*LEDArray) Demo added in v0.2.0

func (led *LEDArray) Demo(count int, delay int, gradientLength int)

Demo runs a demo of the LED capabilities

func (*LEDArray) Display

func (led *LEDArray) Display(delay int) error

Display changes all of the LEDs one at a time delay: sets the time between each LED changing in milliseconds brightness: sets the brightness for the entire thing

func (*LEDArray) Fade

func (led *LEDArray) Fade(target int) error

Fade goes to a new brightness in the duration specified

func (*LEDArray) FadeToggleOnOff added in v0.3.0

func (led *LEDArray) FadeToggleOnOff()

func (*LEDArray) SetBrightness added in v0.3.0

func (led *LEDArray) SetBrightness() error

setBrightness turns the LED array to a brightness value and sets the led.brightness value accordingly if it goes out of bounds, it will be set to min or max

func (*LEDArray) SetMaxBrightness

func (led *LEDArray) SetMaxBrightness() error

SetMaxBrightness fades the LED array to maximum brightness

func (*LEDArray) SetMinBrightness

func (led *LEDArray) SetMinBrightness() error

SetMinBrightness fades the LED array to the minimum brightness

func (*LEDArray) ToggleOnOff added in v0.3.0

func (led *LEDArray) ToggleOnOff()

Jump to

Keyboard shortcuts

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