Adafruit Neopixel Library [PORTED]

Is there any debugger shield for the P1? My project uses all the pins of the Photon and its going to be hard to add JTAG pins without not being able to utilize all my pins.

Anyone know of an update to the Neopixel library that supports the new RGBW pixels?

I would like to know the same thing, jamesarm97. I purchased a spool of the RGBW Neopixels but I am not advanced enough to determine what needs to be changed to allow it to work with the Photon. I currently have an Arduino Uno with a Bluetooth module controlling them for under cabinet lighting in my kitchen, but it’s a pain to control. Would love to get one of my Photons running the lights.

Hi @timb !
Hope you did not try to eat these M&Ms yet… :laughing:

I also want to use the APA106 LEDs (Neopixels) with built-in WS2811 control IC for “status boards”, setting each LED to a specific colour depending on the applicable status.

I wonder if I can omit the level shifter, mentioned in the library text.

You are obviously not using any 3.3v => 5V level shifter with these “PIXELBIT” LEDs.
Are they 3.3V types? (I could not find them and your above link is broken)

Did you try the “neopixels” also without level shifter?

Thanks already for any feedback on this!

Has anyone else had issues with too-short delay times on Photons? Various functions take ms as ints, and I’m finding them executing much faster than specified, e.g.:

bool red(bool be_red, uint8_t wait) {
    if (be_red) {
        colorAll(RED, wait);
    } else {
        colorAll(OFF, wait);
    }
    return !be_red;
}

This gets called as part of a loop:

int flash_delay = 2000;
int flashes = 10;
int final_delay = 20000;
for (int n=0; n<flashes; n++) {
    next_time_red = red(next_time_red, flash_delay);
}
red(true, final_delay);
colorAll(OFF, 1);

The flashes are happening at about 2Hz, instead of 0.5Hz, and the final red call goes red and immediately turns off, though the comment for the function call is // Set all pixels in the strip to a solid color, then wait (ms)

Any help would be appreciated,

Thanks,

Shayne

uint8_t is 8bit unsigned int which only can take values up to 255

2000  = 0b11111010000     -> 0b11010000 = 208
20000 = 0b100111000100000 -> 0b00100000 = 32

Doh! I just glanced at the unsigned part and not the 8-bit part.

Thank you for reminding me to read entire words :smile:

Shayne

1 Like

Hey! Are there plans to implement the RGBW Neopixels soon? Sounds like you were tinkering with them, just wondering if that is working out. Thanks!

I’m wondering this too, any progress on making the library work for RGBW/GBRW?

I have a first-pass of the technobly library this is based off of running RGBWstrandtest.ino using the pinSetFast() and pinResetFast() changes recommended elsewhere. No guarantees that I got all the color ordering correct – this is a machete hack not anything ready for a pull request yet – but it should work.

instantiate with:
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, SK6812RGBW);

library changes:

Feel free to grab the code / send me feedback at jstockdale@gmail.com

###Just updated the NeoPixel library to support the RGBW NeoPixels :grin:

Important:

If you have an old app in Build that you are migrating to a Photon, P1, Electron or Core, please remove the NeoPixel library from your app and re-apply it to update the included library to v0.0.9. If you are creating a new app, simply add the NeoPixel library to your app and you will have the latest v0.0.9.

Live in the Particle Libraries - NeoPixel v0.0.9

https://build.particle.io/libs/5756121cd100a78a5a00067a/tab/rgbw-strandtest.cpp

Changelog v0.0.8 to v0.0.9:

  • Tested on an Adafruit 24-pixel NeoPixel RGBW natural white ring, on Photon and Core.
  • New RGBW PIXEL_TYPE is SK6812RGBW
  • Added new rgbw-strandtest.cpp Example
  • Added more info to the README.md
  • Added these new RGBW functions:
    • setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w);
    • Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w);
    • setColor(uint16_t aLedNumber, byte aRed, byte aGreen, byte aBlue, byte aWhite);
    • setColorScaled(uint16_t aLedNumber, byte aRed, byte aGreen, byte aBlue, byte aWhite, byte aScaling);
    • setColorDimmed(uint16_t aLedNumber, byte aRed, byte aGreen, byte aBlue, byte aWhite, byte aBrightness);
  • Added this new function to dynamically modify the number of pixels at runtime
    • updateLength(uint16_t n);
2 Likes

Just updated the NeoPixel library to support the RedBear Duo device :grin:

Important:

If you have an old app in Build that you are migrating to a Particle Photon, P1, Electron, Spark Core or RedBear Duo please remove the NeoPixel library from your app and re-apply it to update the included library to v0.0.10. If you are creating a new app, simply add the NeoPixel library to your app and you will have the latest v0.0.10.

Live in the Particle Libraries - NeoPixel v0.0.10

https://build.particle.io/libs/57564201d100a7f0f6000952/tab/rgbw-strandtest.cpp

Changelog v0.0.9 to v0.0.10:

  • Tested on RedBear Duo in Particle Internet Button (WS2812B) and with RGBW NeoPixel ring (SK6812RGBW), compiled in Build IDE with v0.2.4 Duo system firmware. Also tested via command line with the CLI.
  • Tweaked rgbw-strandtest.cpp to add all required prototypes for local build/no-preprocessor-build
  • Updated README.md
1 Like

Thanks for this! the 0.0.13 neopixel library doesn’t seem to light up the SK6812RGBW strips, but your rework got them working again.

Just updated the NeoPixel library to support Mesh devices (Argon, Boron and Xenon) thanks to @cullenshane @jvanier @bsatrom @JamesHagerman :grin:

Important:

If you have an old app that you would like to update please remove the NeoPixel library from your app and re-apply it to update the included library to v1.0.0. If you are creating a new app, simply add the NeoPixel library to your app and you will have the latest v1.0.0.

Live in the Particle Libraries - NeoPixel v1.0.0

8 Likes

Woot! Now if we can also get FastLED going, that would be extra awesome…

While the NeoPixel library was submitted by Particle the FastLED library is not.
Currently we have to hope for an update by the original contributor.
I’ve filed a GitHub issue on his repo, but he can’t commit to any ETA yet.

1 Like

Yeah, there was somebody else in the FastLED community forums on G+ asking about it a week or two ago.

I’ve thought about just writing a library of work-alike functions for some of the most common things from FastLED which you could then use with NeoPixel. It probably wouldn’t be anywhere near as optimized, and it probably wouldn’t integrate the same in a lot of places. But it still might be useful for people who are more used to that lib.

QUESTION PLEASE HELP!!!
Thank You in advanced!!

Ok so what am I MISSING?

This ported Neopixel library does not support strip.fill?

I need to be able to set the ENTIRE strip to one color QUICKLY not waiting for it to set individual pixels one by one from one direction but the whole strip all at the same time.

strip.fill(10, 0,0,50);
strip.show();

Error I am getting… ‘class Adafruit_NeoPixel’ has no member named ‘fill’

The FastLED library can do this no problem using
fill_solid();

But I need to do this using NeoPixel library.

Any help anyone can give me would be GREATLY APPRECIATED!!!
Thank you!

When you set each individual pixel separately but only call strip.show() when having that done, all pixels will change (near) simultaneously anyhow.

There also is an example that shows how to do that

// Set all pixels in the strip to a solid color, then wait (ms)
void colorAll(uint32_t c, uint8_t wait) {
  uint16_t i;

  for(i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
  }
  strip.show();
  delay(wait);
}

Are there any plans to update to the latest version of the adafruit library?