Thanks! That's very interesting... I'm just trying here and it seemed to work fine on WS2811, but I do have what I think is a strip of APA106 here (at least they light up blue when power is applied) and that did flicker when using the neopixel library, when using firmware 2v00 all the way to latest (I didn't test earlier).
On closer inspection I realised that there was a tiny spike in the data output line just before transmission started, and it was because require("neopixel").write was re-initialising the SPI peripheral each time before it sent any data (although the code I posted above with send4bit wouldn't have done that).
At least for me, that was throwing off the APA106 (but not WS2811) every so often.
So what I've done now is to remove that initialisation if the SPI device was already initialised, which should work but will just be a pain if you're trying require("neopixel").write on different pins.
If you try the latest 'cutting edge' build then it might fix it for you?
© Espruino, powered by microcosm.
Report a problem