leds

package
v1.0.2-18 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Colors = map[string][]int{
	"black":   {0, 0, 0},
	"red":     {1, 0, 0},
	"green":   {0, 1, 0},
	"blue":    {0, 0, 1},
	"cyan":    {0, 1, 1},
	"magenta": {1, 0, 1},
	"yellow":  {1, 1, 0},
	"white":   {1, 1, 1},
}
View Source
var LedNames = []string{
	"power",
	"wired_internet",
	"wireless",
	"pairing",
	"radio",
}
View Source
var LedPositions = [][]int{
	{15, 13, 14},
	{12, 10, 11},
	{9, 1, 8},
	{2, 4, 3},
	{5, 7, 6},
}

Functions

func LedNameIndex

func LedNameIndex(name string) int

func ValidBrightness

func ValidBrightness(brightness int) bool

func ValidColor

func ValidColor(color string) bool

func ValidLedName

func ValidLedName(name string) bool

Types

type LedArray

type LedArray struct {
	Leds         []int
	LedStates    []LedState
	BlinkOnState bool
	// contains filtered or unexported fields
}

holds the state for an array of leds on our board.

func CreateLedArray

func CreateLedArray() *LedArray

func (*LedArray) Reset

func (l *LedArray) Reset()

func (*LedArray) SetColor

func (l *LedArray) SetColor(position int, color string, flash bool)

func (*LedArray) SetLEDs

func (l *LedArray) SetLEDs()

func (*LedArray) SetPwmBrightness

func (l *LedArray) SetPwmBrightness(brightness int)

type LedState

type LedState struct {
	Flash bool
	Color string
	On    bool
}

Jump to

Keyboard shortcuts

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