NeoPixels with RP2040 Encoders

Not sure if this is the correct forum to post this issue, but I've submitted a few git issues without a real solution.

I've got a Pi Pico using the earlephilhower Pico board profile, win11, IDEv2.3.2

I cannot compile a sketch using the Adafruit NeoPixel Library and any RP2040 compatible encoder library. From what I've gotten from other resources, there is a PIO conflict. Something about Neopixel not fully claiming PIO0's state machines until Neopixel::show() is called and the encoder library unaware of PIO0 being claimed...?!?

A lot of this way over my head. I am just trying to eventually have an encoder control Neopixel strip and eventually apply the effects to a HID joystick device. I'm looking for any solution. I assume this can't that difficult to achieve. Is it possible to force Neopixel to PIO1? Are they any other RP2040 encoder libraries besides PicoEncoder and RP2040-encoder-library?

Here is a link to Wokwi sketch that mirrors my local test sketch, NeoPixel x Encoder fails

  • Run as is, it compiles
  • Uncomment the encoder, Line23 and it breaks
  • Comment all of the Neopixels lines and uncomment the encoder::begin() it compiles.

For the neopixel library, you can try NeoPixelConnect. It defaults to pio0, but you can optionally select pio1.

I don't have any experience with rotary encoders and the RPi 2040, but this article might help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.