Documentation ¶
Index ¶
Constants ¶
const MaxBrightness = 31
MaxBrightness is the highest brightness value supported by the LEDs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FadeUp ¶
type FadeUp struct {
// contains filtered or unexported fields
}
FadeUp will give values for a series of LEDs depending on a pos 0-100 in the animation phase. The animation itself will go from dim first row to gradually brightening the rows of LEDs to the specified LED RGB value
func (*FadeUp) CurrentLEDs ¶
CurrentLEDs returns the slice of LED values depending on the pos 0-1 which represents the position in the animation where 0 is unlit and 1 is fully lit. Any value between is gradually getting brighter row by row.
type LED ¶
type LED struct { //Colour for the LED Colour colorful.Color // Brightness 0-31 value for the LED. It is recommended NOT to use this due to do poor quality Brightness byte }
LED is a representation of an RGB LED
func LEDFromIntRGB ¶
LEDFromIntRGB returns LED objects whom color is based off RGB values 0-255, with max brightness
func LEDFromIntRGBB ¶
LEDFromIntRGBB returns LED objects whom color is based off RGB values 0-255
func ParseColour ¶
ParseColour attempts to parse string hexadecimal representations of colours. eg. "#fff" or "#FEFEFE"
type LEDController ¶
type LEDController struct {
// contains filtered or unexported fields
}
LEDController retains state and methods to control the APA102 on open SPI
func NewLEDController ¶
func NewLEDController(pin rpio.SpiDev) LEDController
NewLEDController will return controller for the LEDs
func (*LEDController) Finish ¶
func (c *LEDController) Finish()
Finish should be called to close the SPI
func (*LEDController) Write ¶
func (c *LEDController) Write(ledSlice []LED)
Write takes a slice of LEDs in the order they are connected.
type SpinnerState ¶
type SpinnerState struct { // LEDCount is the number of LEDs in the ring LEDCount uint // Spread is the number of LEDs that there will be a linear fall-off in brightness Spread byte // BaseLED give the colour at the brightest point in the ring BaseLED LED // contains filtered or unexported fields }
SpinnerState includes the position of the currently lid LED in the ring and parameters
func NewSpinner ¶
func NewSpinner(ledCount uint, spread uint8, baseLED LED) SpinnerState
NewSpinner creates a SpinnerState with sensible parameters
func (*SpinnerState) CurrentState ¶
func (s *SpinnerState) CurrentState() []LED
CurrentState returns the slice of LED values for the current position in the sequence
func (*SpinnerState) Next ¶
func (s *SpinnerState) Next()
Next transitions the spinner to the next state