concertina

Elecronic concertina
git clone https://git.woozle.org/neale/concertina.git

concertina / pkg / led
Neale Pickett  ·  2026-02-12

dotstar.go

 1package led
 2
 3import (
 4	"image/color"
 5	"tinygo.org/x/drivers/apa102"
 6)
 7
 8type DotStar struct {
 9	*apa102.Device
10}
11
12func (d *DotStar) Enable() error {
13	return nil
14}
15
16func (d *DotStar) Disable() {
17}
18
19func (d *DotStar) SetColor(c color.Color) {
20	// sigh. https://github.com/tinygo-org/drivers/issues/837
21	rgba := color.RGBAModel.Convert(c).(color.RGBA)
22	d.WriteColors([]color.RGBA{rgba})
23}
24