Inventor2040W - Driving Neopixels?

Afternoon - i have the 2040 happily running with servos - i want to add a light via a ws28121b neopixel strip but I’m struggling to get them to both work.

Normally i use the Neopixel library from GitHub - blaz-r/pi_pico_neopixel: Pi Pico library for NeoPixel led-strip written in MicroPython. Works with ws2812b (RGB) and sk6812 (RGBW). - and i can get them to light using ```

from neopixel import Neopixel

pixels = Neopixel(10, 4, 0, “RGB”)

but my servos then stop working.

Any hints or suggestions on driving servos and neopixels would be really appreciated,

Andy

Maybe a power issue? 10 Neopixel can draw a lot of current. Another possibility is a ressource collision. The Neopixel driver uses a state-machine. Have you checked that it is not used elsewhere?

Thanks for the answer - power seems ok - i think its the state machine - so the only way i can get the neopixels to work is to set the state machine to 4:

pixels = Neopixel(10, 4, 0, “RGB”)

and this then seems to turn off the servos (?).

Andy

Does using our Plasma library to drive your LED strip work? I think that’s how Inventor drives its own LEDs, so hopefully it should play nicely with the state machines?

I had no joy with the plasma library but got it working by changing the board to 1 - does not seem to conflict now…

pixels = Neopixel(numpix, 1, 0, “RGB”)

:) thanks for the pointers…

Andy

1 Like