Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adafruit Feather nRF52840 Express - onboard neopixel not working #737

Open
jmhobbs opened this issue Feb 12, 2025 · 2 comments
Open

Adafruit Feather nRF52840 Express - onboard neopixel not working #737

jmhobbs opened this issue Feb 12, 2025 · 2 comments

Comments

@jmhobbs
Copy link

jmhobbs commented Feb 12, 2025

I've got a Feather nRF23840 Express with the built in neopixel that I can not make light with ws2812.

I don't believe I have anything wrong in my code.

package main

import (
  "image/color"
  "machine"
  "time"

  "tinygo.org/x/drivers/ws2812"
)

var neo machine.Pin

func main() {
  neo = machine.WS2812
  neo.Configure(machine.PinConfig{Mode: machine.PinOutput})

  ws := ws2812.NewWS2812(neo)
  time.Sleep(500 * time.Millisecond)
  for {
    ws.WriteColors([]color.RGBA{{255, 0, 0, 255}})
    time.Sleep(2500 * time.Millisecond)

    ws.WriteColors([]color.RGBA{{0, 255, 0, 255}})
    time.Sleep(2500 * time.Millisecond)

    ws.WriteColors([]color.RGBA{{0, 0, 255, 255}})
    time.Sleep(2500 * time.Millisecond)
  }
}

I can not find a reference now, but I thought I saw that this board used a WS2812B, and digging around I found that the timings on a B are different than rev A; datasheet adafruit reference code and thought perhaps that was the issue.

I grabbed the driver code and fiddled with the write intervals in an attempt to get it working but did not succeed. I think I understand what is happening in that codegen but I lack a lot of peripheral knowledge here.

It does work when using that Adafruit library and flashing from Arduino IDE.

Thanks!

@sago35
Copy link
Member

sago35 commented Feb 12, 2025

I tried flashing your code onto the Feather nRF52840. It seems to be working correctly on my board.

Image

@jmhobbs
Copy link
Author

jmhobbs commented Feb 12, 2025

Well that's concerning, thank you for checking that @sago35.

I have another version where I also blink the machine.LED pin when I'm changing the neopixel and that works so I know it's flashing on and running OK, tinygo monitor works as well if I drop in println statements.

I will try asking over on the Adafruit support forums for ideas. I would suspect bum hardware but it operates fine from C++ so I'm lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants