Skip to content

Conversation

@SoftTacos
Copy link
Contributor

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

PR for issue: #608

@SoftTacos SoftTacos mentioned this pull request Oct 14, 2023
ws2812/ws2812.go Outdated
Comment on lines 17 to 20
const (
WS2812 DeviceType = iota // RGB
SK6812 // RGBA / RGBW
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we would rather opt for making an entirely separate SK6812 device and leverage the same calls that Deivce.WriteByte uses, I'm happy to do that too.

@deadprogram
Copy link
Member

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
Copy link
Contributor Author

Love it, I'll get that changed soon.

@deadprogram
Copy link
Member

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

@deadprogram deadprogram merged commit 3b183ad into tinygo-org:dev Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants