Skip to content

Commit 5645eb3

Browse files
sago35deadprogram
authored andcommitted
ws2812: add support for qtpy and atsame5x
1 parent 6b914f7 commit 5645eb3

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

examples/ws2812/arduino.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package main
44

55
import "machine"
66

7-
// Replace neo in the code below to match the pin
7+
// Replace neo and led in the code below to match the pin
88
// that you are using if different.
99
var neo = machine.D2
10+
var led = machine.LED

examples/ws2812/digispark.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package main
55
import "machine"
66

77
// This is the pin assignment for the Digispark only.
8-
// Replace neo in the code below to match the pin
8+
// Replace neo and led in the code below to match the pin
99
// that you are using if different.
1010
var neo machine.Pin = 0
11+
var led = machine.LED

examples/ws2812/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
var leds [10]color.RGBA
1616

1717
func main() {
18-
led := machine.LED
1918
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
2019

2120
neo.Configure(machine.PinConfig{Mode: machine.PinOutput})

examples/ws2812/others.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// +build !digispark,!arduino
1+
// +build !digispark,!arduino,!qtpy
22

33
package main
44

55
import "machine"
66

7-
// Replace neo in the code below to match the pin
7+
// Replace neo and led in the code below to match the pin
88
// that you are using if different.
99
var neo machine.Pin = machine.NEOPIXELS
10+
var led = machine.LED

examples/ws2812/qtpy.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// +build qtpy
2+
3+
package main
4+
5+
import "machine"
6+
7+
// Replace neo and led in the code below to match the pin
8+
// that you are using if different.
9+
var neo machine.Pin = machine.NEOPIXELS
10+
var led = machine.NoPin
11+
12+
func init() {
13+
pwr := machine.NEOPIXELS_POWER
14+
pwr.Configure(machine.PinConfig{Mode: machine.PinOutput})
15+
pwr.High()
16+
}

ws2812/ws2812_m4_120m.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build atsamd51
1+
// +build atsamd51 atsame5x
22

33
package ws2812
44

0 commit comments

Comments
 (0)