NeoPixel Library

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
DWiskow
Posts: 11
Joined: Sun Apr 24, 2016 1:23 pm

NeoPixel Library

Post by DWiskow » Mon May 16, 2016 8:13 am

I have both a couple of pyBoard 1.1's and a number of ESP8266 Adafruit and NodeMCU/DOIT boards . . . Having spent the weekend playing with the latest 1.8 release of MicroPython on all of these, I am a little perplexed that the ESP8266 has support for the NeoPixel library built in but the pyBoard version doesn't appear to! . . . Or am I doing something wrong ?

drew
Posts: 1
Joined: Sun Jul 14, 2019 9:00 pm

Re: NeoPixel Library

Post by drew » Sun Jul 14, 2019 9:10 pm

Three years down the line, I'm running MicroPython 1.11 on a pyBoard..... and it still seems to be the case, none of the neopixel library documented on the micropython website seems to apply to the pyBoard. I did get it working ok via a 3rd party library..

klauskn
Posts: 1
Joined: Wed Jul 17, 2019 11:28 am

Re: NeoPixel Library

Post by klauskn » Wed Jul 17, 2019 11:31 am

-> I did get it working ok via a 3rd party library..

Now it would be helpful to know which library you are using.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: NeoPixel Library

Post by jimmo » Wed Jul 17, 2019 11:55 am

Possibly https://github.com/JanBednarik/micropython-ws2812 or https://github.com/nickovs/ws2812-SPI Both of these generate the WS2812 data signal using SPI (by oversampling each bit into several SPI bits).

If you feel like building your own firmware, I have a neopixel driver written in C for pyboard that I've been meaning to find the time to upstream. PM me and I can rebase it onto master and share it. (Currently it adds a "neo" method to machine.Pin that takes an array of RGB data and uses the cycle counter to generate accurate timing for the WS2812 data signal, there's a corresponding neopixel.py that provides an easy high-level API to managing the RGB data -- looks just like the micro:bit or esp8266 neopixel library, with some extra methods -- Obviously to upstream it I have to not make it a method on Pin! :) ).

It's worth mentioning though -- if you have the choice, use DotStars (APA102) instead of Neopixels, because they have a much nicer SPI interface.

lucille
Posts: 1
Joined: Sat Jan 04, 2020 9:27 pm

Re: NeoPixel Library

Post by lucille » Sat Jan 04, 2020 9:33 pm

jimmo wrote:
Wed Jul 17, 2019 11:55 am
Possibly https://github.com/JanBednarik/micropython-ws2812 or https://github.com/nickovs/ws2812-SPI Both of these generate the WS2812 data signal using SPI (by oversampling each bit into several SPI bits).

If you feel like building your own firmware, I have a neopixel driver written in C for pyboard that I've been meaning to find the time to upstream. PM me and I can rebase it onto master and share it. (Currently it adds a "neo" method to machine.Pin that takes an array of RGB data and uses the cycle counter to generate accurate timing for the WS2812 data signal, there's a corresponding neopixel.py that provides an easy high-level API to managing the RGB data -- looks just like the micro:bit or esp8266 neopixel library, with some extra methods -- Obviously to upstream it I have to not make it a method on Pin! :) ).

It's worth mentioning though -- if you have the choice, use DotStars (APA102) instead of Neopixels, because they have a much nicer SPI interface.
Hi Jimmo,

can you share that C code please?

Best Regards.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: NeoPixel Library

Post by jimmo » Sun Jan 05, 2020 5:03 am

lucille wrote:
Sat Jan 04, 2020 9:33 pm
can you share that C code please?
Even better, Damien created a PR a few weeks ago (hopefully to be merged soon) that adds a proper driver to the stm32 port: https://github.com/micropython/micropython/pull/5318

Post Reply