Documentation
¶
Overview ¶
Package blinkt provides control over a Blinkt! LED display
Index ¶
- type APA102
- type Blinkt
- func (bl *Blinkt) Clear()
- func (bl *Blinkt) ClearPixel(p int)
- func (bl *Blinkt) Close()
- func (bl *Blinkt) SetAll(r, g, b int)
- func (bl *Blinkt) SetBrightness(brightness float64)
- func (bl *Blinkt) SetClearOnExit(clearOnExit bool)
- func (bl *Blinkt) SetPixel(p, r, g, b int)
- func (bl *Blinkt) SetPixelBrightness(p int, brightness float64)
- func (bl *Blinkt) Show()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APA102 ¶
type APA102 struct {
// contains filtered or unexported fields
}
APA102 implements the interface to the Blinkt! hardware
func (*APA102) WriteFrame ¶
WriteFrame writes a single LED frame to the APA102.
The frame value is passed as a 32bit uint and it clocked out MSB first.
func (*APA102) WritePixels ¶
func (a *APA102) WritePixels(pixels []pixel)
WritePixels writes a sequence of pixels to the display.
The pixels are prefixed with a start frame and terminated with the end frame.
type Blinkt ¶
type Blinkt struct {
// Pixels is the number of pixels supported by the display
Pixels int
// contains filtered or unexported fields
}
Blinkt provides control over a Blinkt! LED display
func (*Blinkt) Clear ¶
func (bl *Blinkt) Clear()
Clear sets all the pixels to off.
Show must still be called to update the physical display.
func (*Blinkt) ClearPixel ¶
ClearPixel sets the pixel to off.
Show must still be called to update the physical display.
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 should be in percent, i.e. 0 to 100.0. Greater than or equal to 100 is assumed to mean full brightness. Less than or equal to 0 is assumed to mean off.
func (*Blinkt) SetClearOnExit ¶
SetClearOnExit controls the blanking of the display when the Blinkt is closed.
When clearOneExit is true all pixels are turned off when Blinkt is closed. This is the default. When clearOneExit is false the display is left in its current state.
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 should be in percent, i.e. 0 to 100.0. Greater than or equal to 100 is assumed to mean full brightness. Less than or equal to 0 is assumed to mean off.
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
1dtetris
command
A blinkt demo that displays the currrent time in binary.
|
A blinkt demo that displays the currrent time in binary. |
|
binary_clock
command
A blinkt demo that displays the currrent time in binary.
|
A blinkt demo that displays the currrent time in binary. |
|
binary_clock_meld
command
A blinkt demo that displays the currrent time in binary.
|
A blinkt demo that displays the currrent time in binary. |
|
cheerlights
command
A blinkt demo that displays the current CheerLights colour.
|
A blinkt demo that displays the current CheerLights colour. |
|
cputemp
command
A blinkt demo that displays the CPU temperature.
|
A blinkt demo that displays the CPU temperature. |
|
helpers/jsonclient
command
|
|
|
helpers/redis_sender
command
|
|
|
progress
command
A blinkt demo that cycles a red led backwards and forwards across the display, Cylon style.
|
A blinkt demo that cycles a red led backwards and forwards across the display, Cylon style. |
|
rainbow
command
A blinkt demo that cycles a rainbow of colours.
|
A blinkt demo that cycles a rainbow of colours. |
|
random_blink
command
A blinkt demo that continually sets the led to random colours.
|
A blinkt demo that continually sets the led to random colours. |
|
random_blink_colours
command
A blinkt demo that continually sets the leds to random colours.
|
A blinkt demo that continually sets the leds to random colours. |
|
redis_view
command
A blinkt demo that sets the display using values provided by a Redis pubsub channel.
|
A blinkt demo that sets the display using values provided by a Redis pubsub channel. |
|
resistor_clock
command
A blinkt demo that displays the currrent time using resistor band colours.
|
A blinkt demo that displays the currrent time using resistor band colours. |
|
solid_colours
command
A blinkt demo that cycles the whole display through red green and blue.
|
A blinkt demo that cycles the whole display through red green and blue. |
|
solid_colours_brightness
command
A blinkt demo that cycles the whole display through red green and blue with varying brightness.
|
A blinkt demo that cycles the whole display through red green and blue with varying brightness. |
|
spacecount
command
|