ws2812: add support for qtpy and atsame5x

This commit is contained in:
sago35
2021-05-30 11:49:53 +09:00
committed by Ron Evans
parent 6b914f7af7
commit 5645eb3f91
6 changed files with 24 additions and 6 deletions
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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
-1
View File
@@ -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})
+3 -2
View File
@@ -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
+16
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
// +build atsamd51
// +build atsamd51 atsame5x
package ws2812