Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ws2812/ws2812.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ func NewWS2812(pin machine.Pin) Device {
return newWS2812Device(pin)
}

// New returns a new SK6812(RGBA) driver.
// It does not touch the pin object: you have
// to configure it as an output pin before calling New.
// 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 NewSK6812(pin machine.Pin) Device {
return Device{
Pin: pin,
Expand Down
2 changes: 1 addition & 1 deletion ws2812/ws2812_init_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import "machine"

// newWS2812Device creates a WS2812 device using the bit-bang driver.
func newWS2812Device(pin machine.Pin) Device {
return Device{Pin: pin, writeColorFunc: writeColorsRGB}
return Device{Pin: pin, brightness: 255, writeColorFunc: writeColorsRGB}
}
4 changes: 2 additions & 2 deletions ws2812/ws2812_rp2_pio.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
func newWS2812Device(pin machine.Pin) Device {
sm, err := pio.PIO0.ClaimStateMachine()
if err != nil {
return Device{Pin: pin, writeColorFunc: writeColorsRGB}
return Device{Pin: pin, brightness: 255, writeColorFunc: writeColorsRGB}
}
ws, err := piolib.NewWS2812B(sm, pin)
if err != nil {
return Device{Pin: pin, writeColorFunc: writeColorsRGB}
return Device{Pin: pin, brightness: 255, writeColorFunc: writeColorsRGB}
}
return Device{
Pin: pin,
Expand Down