diff --git a/ws2812/ws2812_generic.go b/ws2812/ws2812_generic.go new file mode 100644 index 0000000..2503057 --- /dev/null +++ b/ws2812/ws2812_generic.go @@ -0,0 +1,16 @@ +// +build !baremetal + +package ws2812 + +// This file implements the WS2812 protocol for simulation. + +import "machine" + +// Send a single byte using the WS2812 protocol. +func (d Device) WriteByte(c byte) error { + writeByte(d.Pin, c) + return nil +} + +//go:export __tinygo_ws2812_write_byte +func writeByte(pin machine.Pin, c byte) diff --git a/ws2812/ws2812_m0_48m.go b/ws2812/ws2812_m0_48m.go index 1f558a0..71d0c7d 100644 --- a/ws2812/ws2812_m0_48m.go +++ b/ws2812/ws2812_m0_48m.go @@ -1,4 +1,4 @@ -// +build circuitplay_express itsybitsy_m0 arduino_nano33 feather_m0 trinket_m0 +// +build atsamd21 package ws2812