+
Skip to content

Adafruit Feather nRF52840 Express - onboard neopixel not working #737

@jmhobbs

Description

@jmhobbs

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载