Documentation
¶
Overview ¶
Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips.
On most platforms NewWS2812 uses bit-banging. On RP2040/RP2350 it uses PIO for hardware-timed control.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
Device wraps a pin object for an easy driver interface.
func New ¶
deprecated, use NewWS2812 or NewSK6812 depending on which device you want. calls NewWS2812() to avoid breaking everyone's existing code.
func NewSK6812 ¶ added in v0.27.0
NewSK6812 returns a new SK6812W/RGBW driver (4 channels, GRBW order, 32-bit protocol), for the 3 channels version use NewWS2812 Use this for SK6812W strips that have a dedicated white channel controlled via color.A. It does not touch the pin object: you have to configure it as an output pin before calling this.
func NewWS2812 ¶ added in v0.27.0
NewWS2812 returns a new WS2812(RGB) driver. On RP2040/RP2350, it uses PIO for hardware-timed control. On other platforms, you must configure the pin as output before calling this.
func (*Device) SetBrightness ¶ added in v0.35.0
SetBrightness sets the global brightness (0-255).