NeoPixel Library
NeoPixel Library
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 ?
Re: NeoPixel Library
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..
Re: NeoPixel Library
-> I did get it working ok via a 3rd party library..
Now it would be helpful to know which library you are using.
Now it would be helpful to know which library you are using.
Re: NeoPixel Library
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.
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.
Re: NeoPixel Library
Hi Jimmo,jimmo wrote: ↑Wed Jul 17, 2019 11:55 amPossibly 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.
can you share that C code please?
Best Regards.
Re: NeoPixel Library
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