From 10bd48c39d9885e0e0901ad61665ded2ee2407b3 Mon Sep 17 00:00:00 2001 From: sago35 Date: Thu, 27 Jan 2022 18:03:00 +0900 Subject: [PATCH] ws2812: add support for m5stamp-c3 --- examples/ws2812/others.go | 4 ++-- examples/ws2812/others_wo_led.go | 11 +++++++++++ examples/ws2812/qtpy.go | 5 ----- 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 examples/ws2812/others_wo_led.go diff --git a/examples/ws2812/others.go b/examples/ws2812/others.go index f202eaf..10cb248 100644 --- a/examples/ws2812/others.go +++ b/examples/ws2812/others.go @@ -1,5 +1,5 @@ -//go:build !digispark && !arduino && !qtpy -// +build !digispark,!arduino,!qtpy +//go:build !digispark && !arduino && !qtpy && !m5stamp_c3 +// +build !digispark,!arduino,!qtpy,!m5stamp_c3 package main diff --git a/examples/ws2812/others_wo_led.go b/examples/ws2812/others_wo_led.go new file mode 100644 index 0000000..107d3a4 --- /dev/null +++ b/examples/ws2812/others_wo_led.go @@ -0,0 +1,11 @@ +//go:build qtpy || m5stamp_c3 +// +build qtpy m5stamp_c3 + +package main + +import "machine" + +// Replace neo and led in the code below to match the pin +// that you are using if different. +var neo machine.Pin = machine.WS2812 +var led = machine.NoPin diff --git a/examples/ws2812/qtpy.go b/examples/ws2812/qtpy.go index a22ad99..a35bcd2 100644 --- a/examples/ws2812/qtpy.go +++ b/examples/ws2812/qtpy.go @@ -5,11 +5,6 @@ package main import "machine" -// Replace neo and led in the code below to match the pin -// that you are using if different. -var neo machine.Pin = machine.NEOPIXELS -var led = machine.NoPin - func init() { pwr := machine.NEOPIXELS_POWER pwr.Configure(machine.PinConfig{Mode: machine.PinOutput})