mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-03 06:27:47 +00:00
ws2812: add support for simulation
Call a special __tinygo_ws2812_write_byte function to send a single byte.
This commit is contained in:
committed by
Ron Evans
parent
514b436889
commit
7b56e61d52
@@ -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)
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build circuitplay_express itsybitsy_m0 arduino_nano33 feather_m0 trinket_m0
|
||||
// +build atsamd21
|
||||
|
||||
package ws2812
|
||||
|
||||
|
||||
Reference in New Issue
Block a user