Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/ws2812/arduino.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ 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.D2
var led = machine.LED
func init() {
// Replace neo in the code below to match the pin
// that you are using if different.
neo = machine.D2
}
11 changes: 6 additions & 5 deletions examples/ws2812/digispark.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ package main

import "machine"

// This is the pin assignment for the Digispark only.
// 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
func init() {
// This is the pin assignment for the Digispark only.
// Replace neo and led in the code below to match the pin
// that you are using if different.
neo = machine.Pin(0)
}
8 changes: 4 additions & 4 deletions examples/ws2812/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import (
"tinygo.org/x/drivers/ws2812"
)

var leds [10]color.RGBA
var (
neo machine.Pin
leds [10]color.RGBA
)

func main() {
led.Configure(machine.PinConfig{Mode: machine.PinOutput})

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

ws := ws2812.NewWS2812(neo)
Expand All @@ -35,7 +36,6 @@ func main() {
}

ws.WriteColors(leds[:])
led.Set(rg)
time.Sleep(100 * time.Millisecond)
}
}
11 changes: 6 additions & 5 deletions examples/ws2812/others.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//go:build !digispark && !arduino && !qtpy && !m5stamp_c3 && !thingplus_rp2040
//go:build !digispark && !arduino

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.LED
func init() {
// Replace neo in the code below to match the pin
// that you are using if different.
neo = machine.WS2812
}
10 changes: 0 additions & 10 deletions examples/ws2812/others_wo_led.go

This file was deleted.

12 changes: 0 additions & 12 deletions examples/ws2812/thingplus-rp2040.go

This file was deleted.