diff --git a/ws2812/ws2812.go b/ws2812/ws2812.go index 22c9432..981e18a 100644 --- a/ws2812/ws2812.go +++ b/ws2812/ws2812.go @@ -1,13 +1,17 @@ +// Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips. package ws2812 import ( "machine" ) +// WS2812 wraps a pin object for an easy driver interface. type WS2812 struct { Pin machine.GPIO } +// New returns a new WS2812 driver. It does not touch the pin object: you have +// to configure it as an output pin before calling New. func New(pin machine.GPIO) WS2812 { return WS2812{pin} } diff --git a/ws2812/ws2812_m0_16m.go b/ws2812/ws2812_m0_16m.go index e2b59cb..e689c07 100644 --- a/ws2812/ws2812_m0_16m.go +++ b/ws2812/ws2812_m0_16m.go @@ -2,6 +2,9 @@ package ws2812 +// This file implements the WS2812 protocol for 16MHz Cortex-M0 +// microcontrollers. + import ( "device/arm" )