Closed ysoldak closed 11 months ago
I checked on the Circuit Playground Express (same chip) and it works fine. Can you double check:
If it's not a wire, it's hard to say what's wrong. It might be a faulty crystal oscillator or any number of other things. The way to know for sure is to connect it to a logic analyzer and look at the signal.
Something else you could try: testing the same setup but using the Arduino IDE and a library like FastLED.
I've verified again, here are results:
Control (XIAO RP2040) - Correct
Experiment (XIAO SAMD21) - Too bright
Here is overview of the setup, wires indeed quite long and connections may be weak, but it works for control...
To make this work, I've added following two files to the ws2812 example.
And unmatched these tags in others.go
XIAO RP2040
./examples/ws2812/xiao-rp2040.go
//go:build xiao_rp2040
package main
import "machine"
var neo = machine.D8
var led = machine.LED
func init() {
machine.NEOPIXEL_POWER.Configure(machine.PinConfig{Mode: machine.PinOutput})
machine.NEOPIXEL_POWER.High()
}
tinygo flash -target=xiao-rp2040 -size=full ./examples/ws2812/
XIAO SAMD21
./examples/ws2812/xiao.go
//go:build xiao
package main
import "machine"
var neo = machine.D8
var led = machine.LED
tinygo flash -target=xiao -size=full ./examples/ws2812/
This was just something I've observed when working on a random project that runs on RP2040 now anyway. So this bug(?) does not block me in any way and I'm too lazy to debug this further. Let it be more as FYI and we can look at this closer if more cases like this emerge.
P.S. LED strip we can rule out from the equation, the problem first discovered with another strip (different size and brand), same result.
I don't have a Xiao so unfortunately I can't debug this issue myself. But here are some other ideas to narrow down this problem:
Tried with another XIAO board and another pin -- same result.
Also, tried with Arduino Nano 33 IoT board, same chip. Same bad result.
An observation: on XIAO-RP2040 all output pins work fine, except D10. In D10 case only one LED is lit up, too bright and slightly pulsing. This in contrast with SAMD21 there all leds are brightly lit up.
Code of my experiments you can find in #575 pull request.
I have been able to reproduce this issue using an Arduino Nano 33 IoT. I'll see what I can do.
Here is a fix: https://github.com/tinygo-org/tinygo/pull/3751 Can you test it on the XIAO?
An observation: on XIAO-RP2040 all output pins work fine, except D10. In D10 case only one LED is lit up, too bright and slightly pulsing. This in contrast with SAMD21 there all leds are brightly lit up.
This is an unrelated issue, as it's an entirely different chip. If this is a problem for you, you can open a new issue.
Can you test it on the XIAO?
I did, it works now, thank you.
This is an unrelated issue, as it's an entirely different chip. If this is a problem for you, you can open a new issue.
Not a problem at all, just an observation I thought worth to share. No fix needed as any other pin can be used for workaround.
Feel free to close this as fixed when you see fit, otherwise I do that after TinyGo v0.28 is released.
Fixed in TinyGo v0.28
I've tried to drive RGB Led with XIAO board (SAMD21, 48MHz chip) and it does not work.
When trying the example, all 10 LEDs are very bright, almost white. One can see a hint of green and red, changing though.
Same example on a RP2040 (125MHz) board just works (blinking green and red).