ledbutton

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LedColor

func LedColor(color LEDColor) func(*LedButton)

LedColor is a functional option to set the color of the LED.

func Text

func Text(text string) func(*LedButton)

Text is a functional option for providing the initial text on the LED Button. Max 5 characters.

func TextColor

func TextColor(c image.Uniform) func(*LedButton)

TextColor is a functional option which sets the text color.

Types

type LEDColor

type LEDColor int

LEDColor is the type which defines the colors of the LED

const (
	//LEDRed is a red LED
	LEDRed LEDColor = iota
	// LEDGreen is a green LED
	LEDGreen
	// LEDYellow is a yellow LED
	LEDYellow
	// LEDOff turns the LED off
	LEDOff
)

type LedButton

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

LedButton simulates a Button with a status LED.

func NewLedButton

func NewLedButton(sd *sd.StreamDeck, id int, options ...func(*LedButton)) (*LedButton, error)

NewLedButton is the constructor for a new Led Button. Functional arguments can be supplied to modify it's default characteristics

func (*LedButton) Change

func (btn *LedButton) Change(state sd.BtnState)

Change button state

func (*LedButton) Draw

func (btn *LedButton) Draw() error

Draw renders the Button

func (*LedButton) SetState

func (btn *LedButton) SetState(state bool) error

SetState sets the state of the LED and renders the Button.

func (*LedButton) SetText

func (btn *LedButton) SetText(text string) error

SetText sets the text (max 5 Chars) on the LedButton. The result will be rendered immediately.

func (*LedButton) State

func (btn *LedButton) State() bool

State returns the state of the LED

Jump to

Keyboard shortcuts

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