Left for archival purposes.

User avatar
By phermansson
#15253 Thats ok, just have to fix it myself :)
Maybe someone can help me a little though. I looked at Arduino code for the 8mm Neopixels and compared it to code for a 16 pixel ring. Made these observations:
Code: Select allSetup in Arduino code.
With Neopixel ring:
Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800);

With 8mm Neopixels:
Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, PIN, NEO_RGB + NEO_KHZ800);

Note from Adafruit about the 8mm Neopixels:
"Note that these are "RGB" instead of "GRB" format used in the 5050-sized LEDs you are so used to."
WS2811 datasheet these are running at 800KHz.

From Arduino lib:
  if(t & NEO_GRB) { // GRB vs RGB; might add others if needed
    rOffset = 1;
    gOffset = 0;
    bOffset = 2;
  } else if (t & NEO_BRG) {
    rOffset = 1;
    gOffset = 2;
    bOffset = 0;


It seems like the only difference is a swap of the red and green color values. If so, wouldn't the code work although showing the wrong colors?
User avatar
By andrew melvin
#15602 It bloody works! Thank you!

For whatever reason i don't have notifications on this forum, so i have to check back. I've been busy writing other stuff and forgot about this project...

It works.... works like a charm... thank you...

I'll try and get it working with the adafruit style of lib... so you can issue one command and get a sweep effect... or something like that...
User avatar
By andrew melvin
#15671 A few hours of work yesterday... me trying to understand how the adafruit lib worked, learning about classes and stuff as i've never touched them before.... getting to grips with pointers and something totally new to me.. casting.... and voila... I'm driving 60 WS2812s, using GPIO2 on a ESP01, using the arduino IDE. Credits due to adafruit and to you Markus of course.

I have a (seemingly) working library that is 100% compatible with the adafruit demos, so the demo code just works... looks amazing... I will post here shortly... need to do something else first... gf wants me to tidy! It would be great if people could test it, see how far it can go. This is my longest strip (60), and i've not had a chance to run it with other things... i.e. web server, MQTT etc...

Go easy on me... if i've done anything wrong. this is literally my first stab at a lib, and i've only been writing C, since this arduino IDE for ESP came out. prior to that it was NODEMCU for about 1month and that is about my coding experience.

Image
User avatar
By andrew melvin
#15679 Here is the zip with the lib.

I've included two examples. One is the basic strand test from adafruit. This is based on work by Markus, so thank you.

The second uses the ticker library to drive the outputs using interrupts. which works quite nicely.

My plan is to try and have both the char array holding the pixels, and the update of the strand driven by interrupts so that other functions such as web server, MQTT can run in the background. As it stands the strand test driven by for loops, and delay.. which will block other functions.

I have not got that far yet. Feed back welcome, this is first go, so it is messy.
Attachments
(10.91 KiB) Downloaded 324 times