Documentation ¶
Index ¶
- Constants
- func Hex2RGB(color string) (int, int, int)
- type Blinkt
- func (bl *Blinkt) Cleanup()
- func (bl *Blinkt) Clear()
- func (bl *Blinkt) FlashAll(times int, color string)
- func (bl *Blinkt) FlashPixel(pixel, times int, color string)
- func (bl *Blinkt) SetAll(r int, g int, b int) *Blinkt
- func (bl *Blinkt) SetBrightness(brightness float64) *Blinkt
- func (bl *Blinkt) SetPixel(p int, r int, g int, b int) *Blinkt
- func (bl *Blinkt) SetPixelBrightness(p int, brightness float64) *Blinkt
- func (bl *Blinkt) SetPixelHex(p int, color string) *Blinkt
- func (bl *Blinkt) Setup()
- func (bl *Blinkt) SetupExit()
- func (bl *Blinkt) Show() *Blinkt
- func (bl *Blinkt) ShowFinalAnim()
- func (bl *Blinkt) ShowInitialAnim()
Constants ¶
const CLK int = 24
CLK is the clock pin for Blinkt
const DAT int = 23
DAT is the Data pin for Blinkt
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Blinkt ¶
type Blinkt struct { ShowAnimOnStart bool CaptureExit bool ShowAnimOnExit bool ClearOnExit bool // contains filtered or unexported fields }
Blinkt holds the pixel array and related functions
func NewBlinkt ¶
NewBlinkt creates a Blinkt to interact with. You must call "Setup()" after initial config.
func (*Blinkt) Clear ¶
func (bl *Blinkt) Clear()
Clear sets all the pixels to off, you still have to call Show.
func (*Blinkt) FlashPixel ¶
FlashPixel will flash a pixel on and off specified times and color
func (*Blinkt) SetAll ¶
SetAll sets all pixels to specified r, g, b colour. Show must be called to update the LEDs.
func (*Blinkt) SetBrightness ¶
SetBrightness sets the brightness of all pixels. Brightness supplied should be between: 0.0 to 1.0
func (*Blinkt) SetPixel ¶
SetPixel sets an individual pixel to specified r, g, b colour. Show must be called to update the LEDs.
func (*Blinkt) SetPixelBrightness ¶
SetPixelBrightness sets the brightness of pixel p. Brightness supplied should be between: 0.0 to 1.0
func (*Blinkt) SetPixelHex ¶
SetPixelHex sets an individual pixel to specified Hex colour. Show must be called to update the LEDs.
func (*Blinkt) SetupExit ¶
func (bl *Blinkt) SetupExit()
SetupExit captures Interrupt and SIGTERM signals to handle program exit
func (*Blinkt) ShowFinalAnim ¶
func (bl *Blinkt) ShowFinalAnim()
ShowFinalAnim displays a "start" light animation
func (*Blinkt) ShowInitialAnim ¶
func (bl *Blinkt) ShowInitialAnim()
ShowInitialAnim displays a "start" light animation