Neopixel RGBW
Neopixel RGBW
I'm trying to use an RGBW NeoPixel strip from my MicroBit and it works using CodeBlocks but I can't get access to the white pixel using MicroPython (https://python.microbit.org). It looks like the version of the neopixel module is an old version before the 4 colour LED's were supported. Despite a lot of Googling I'm at a loss as to whether I need to :
- import a different module
- create the strip using neopixel.NeoPixelRGBW(pin0,60) [doesn't work]
- create the strip using neopixel.NeoPixel(pin0,60,bpp=4) [doesn't work]
- give up trying to use MicroPython and look for an alternative python IDE
- Something else I've not thought of
- import a different module
- create the strip using neopixel.NeoPixelRGBW(pin0,60) [doesn't work]
- create the strip using neopixel.NeoPixel(pin0,60,bpp=4) [doesn't work]
- give up trying to use MicroPython and look for an alternative python IDE
- Something else I've not thought of
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Neopixel RGBW
Regarding you looking for an IDE have you thought of Mu editor.
It has been written for microbit and other python environments.
There's a button to start REPL (read-eval-print-loop) and one to facilitate file transfer between host computer and microbit
It has been written for microbit and other python environments.
There's a button to start REPL (read-eval-print-loop) and one to facilitate file transfer between host computer and microbit
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Neopixel RGBW
What's the part number of your rgbw LED?
Re: Neopixel RGBW
Hi, the part number for the LED strip is ADA2842.
I'll take a look at the Mu Editor, thanks for that.
Regards, Jim.
I'll take a look at the Mu Editor, thanks for that.
Regards, Jim.
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Neopixel RGBW
Ask about upcoming functionality by logging an issue on github
Re: Neopixel RGBW
Assuming I'm reading Github correctly it's already been included. My problem is that I don't know how to get that into my MicroPython code in the MicroBit python editor. Perhaps it will be clearer if I'm using an offline IDE. I'm still not 100% clear on how python "magically" knows where to get the imported modules from and how to point it at other versions.
Regards, Jim.
Regards, Jim.
Re: Neopixel RGBW
The online editor is ancient, and updating it involves a lot of red tape and jumping trough hoops.
Best use the Mu editor, as it includes a recent version of MicroPython, and lets you work without Internet connection.
Best use the Mu editor, as it includes a recent version of MicroPython, and lets you work without Internet connection.
Re: Neopixel RGBW
Going back to the Github item I was looking at regarding RGBW support for the NeoPixel MicroPython module (https://github.com/micropython/micropython/issues/2478) I think I've misread the thread. One of the contributors stated that RGBW is supported in the driver, which I think is referring to the underlying C code for NeoPixels and not the MicroPython module. There's another comment on Github (https://github.com/bbcmicrobit/micropython/issues/500) which is requesting RGBW support but there is nothing to follo up on that, at least not that I can find.
So I think my options are:
So I think my options are:
- Find the source for the MicroPython NeoPixel module and modify it myself
- Look for an alternative module that has RGBW support
- Dust off my C hat and find/write something myself
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Neopixel RGBW
The neopixel module is written in arm thumb2 assembly i think
Re: Neopixel RGBW
From what I can tell there's a C/C++ API for the Arduino that can be used/adapted for the MicroBit but if I need to dust off my assembler hat then so be it. Ultimately I could go to a lower level and find out the timings for sending data down an IO line to the strip, but the only datasheet I've found thus far is a fairly badly translated version from Chinese!
I'm surprised there's no updated MicroPython module but I guess someome has to write it and if there's only one person that has requested it then it's unlikely to get done.
I'm surprised there's no updated MicroPython module but I guess someome has to write it and if there's only one person that has requested it then it's unlikely to get done.