tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
585 stars 180 forks source link

added support for SK6812 to WS2812 device #610

Closed SoftTacos closed 7 months ago

SoftTacos commented 8 months ago

Adds support for SK6812 (RGBA) LEDs to WS2812 device.

PR for issue: https://github.com/tinygo-org/drivers/issues/608

deadprogram commented 8 months ago

Probably creating specific constructors vs. modifying the current one would be a better approach.

// deprecated, use NewWS2812 or NewSK6812 depending on which device you want.
// calls NewWS2812() to avoid breaking everyone's existing code.
func New(pin machine.Pin) Device

// returns WS2812
func NewWS2812(pin machine.Pin) Device

// returns SK6812
func NewSK6812(pin machine.Pin) Device
SoftTacos commented 8 months ago

Love it, I'll get that changed soon.

deadprogram commented 7 months ago

Thanks for working on this @SoftTacos now squash/merging.