mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-02 22:17:49 +00:00
ws2812: add support for qtpy and atsame5x
This commit is contained in:
@@ -4,6 +4,7 @@ package main
|
||||
|
||||
import "machine"
|
||||
|
||||
// Replace neo in the code below to match the pin
|
||||
// Replace neo and led in the code below to match the pin
|
||||
// that you are using if different.
|
||||
var neo = machine.D2
|
||||
var led = machine.LED
|
||||
|
||||
@@ -5,6 +5,7 @@ package main
|
||||
import "machine"
|
||||
|
||||
// This is the pin assignment for the Digispark only.
|
||||
// Replace neo in the code below to match the pin
|
||||
// Replace neo and led in the code below to match the pin
|
||||
// that you are using if different.
|
||||
var neo machine.Pin = 0
|
||||
var led = machine.LED
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
var leds [10]color.RGBA
|
||||
|
||||
func main() {
|
||||
led := machine.LED
|
||||
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||
|
||||
neo.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// +build !digispark,!arduino
|
||||
// +build !digispark,!arduino,!qtpy
|
||||
|
||||
package main
|
||||
|
||||
import "machine"
|
||||
|
||||
// Replace neo in the code below to match the pin
|
||||
// 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.LED
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// +build qtpy
|
||||
|
||||
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})
|
||||
pwr.High()
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build atsamd51
|
||||
// +build atsamd51 atsame5x
|
||||
|
||||
package ws2812
|
||||
|
||||
|
||||
Reference in New Issue
Block a user