Documentation ¶
Index ¶
Constants ¶
const ( ADDRESS = 0x23 CHANGE_ADDRESS = 0xC7 CHANGE_LED_LENGTH = 0x70 WRITE_SINGLE_LED_COLOR = 0x71 WRITE_ALL_LED_COLOR = 0x72 WRITE_RED_ARRAY = 0x73 WRITE_GREEN_ARRAY = 0x74 WRITE_BLUE_ARRAY = 0x75 WRITE_SINGLE_LED_BRIGHTNESS = 0x76 WRITE_ALL_LED_BRIGHTNESS = 0x77 WRITE_ALL_LED_OFF = 0x78 )
Constants/addresses used for I2C.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Address uint8 // contains filtered or unexported fields }
Device wraps an I2C connection to a Sparkfun Qwiic LED Stick - APA102C.
func New ¶
New creates a new LED Stick connection. The I2C bus must already be configured. This function only creates the Device object, it does not touch the device.
func (*Device) SetAllLedBrightness ¶
Change the brightness of all LEDs, while keeping their current color. Brightness must be a value between 0-31. To turn all LEDs off but remember their previous color, set brightness to 0.
func (*Device) SetAllLedColor ¶
Set the color of all leds to the same RGB color.
func (*Device) SetLedBrightness ¶
Set the brightness of a single LED. LEDs are indexed starting at 0. Brightness must be a value between 0-31.
func (*Device) SetLedColor ¶
Set the color of a single LED to an RGB color. LEDs are indexed starting at 0.