README ¶
#PiGlow
The PiGlow is a small add on board for the Raspberry Pi that provides 18 individually controllable LEDs. This board uses the SN3218 8-bit 18-channel PWM chip to drive 18 surface mount LEDs. Communication is done via I2C over the GPIO header with a bus address of 0x54. Each LED can be set to a PWM value of between 0 and 255.
##Datasheet:
Documentation ¶
Overview ¶
Package piglow implements a driver for the Pimoroni PiGlow.
Index ¶
- type PiGlow
- func (p *PiGlow) Blue(level int) error
- func (p *PiGlow) Close() error
- func (p *PiGlow) Enable() error
- func (p *PiGlow) Green(level int) error
- func (p *PiGlow) Orange(level int) error
- func (p *PiGlow) Red(level int) error
- func (p *PiGlow) Reset() error
- func (p *PiGlow) SetBrightness(level int) error
- func (p *PiGlow) SetLEDBrightness(led, level int) error
- func (p *PiGlow) SetLEDControlRegister(register, enables int) error
- func (p *PiGlow) Setup() error
- func (p *PiGlow) Shutdown() error
- func (p *PiGlow) White(level int) error
- func (p *PiGlow) Yellow(level int) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PiGlow ¶
type PiGlow struct {
// contains filtered or unexported fields
}
PiGlow represents a PiGlow device
func Open ¶
Open opens a new PiGlow. A PiGlow must be closed if no longer in use. If the PiGlow has not been powered down since last use, it will be opened with it's last programmed state.
func (*PiGlow) Close ¶
Close frees the underlying resources. It must be called once the PiGlow is no longer in use.
func (*PiGlow) SetBrightness ¶
SetBrightness sets all the LEDs to the level 0-255.
func (*PiGlow) SetLEDBrightness ¶
SetLEDBrightness sets the led 1-18 to the level 0-255.
func (*PiGlow) SetLEDControlRegister ¶
SetLEDControlRegister sets the control register 1-3 to the bitmask enables.
bitmask definition: 0 - LED disabled 1 - LED enabled LED Control Register 1 - LED channel 1 to 6 bits 0-5 LED Control Register 2 - LED channel 7 to 12 bits 0-5 LED Control Register 3 - LED channel 13 to 18 bits 0-5
func (*PiGlow) Setup ¶
Setup enables normal operations, resets the internal registers, and enables all LED control registers