Adafruit Neopixel Library [PORTED]


#181

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!


#182

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


#183

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

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

#184

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


#185

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!


#186

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


#187

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


FamiLamp: Cloud-Synchronized Color-Selectable Lamps
#188

###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);

Connecting a keypad over I2C
#189

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

#190

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.


#191

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

https://build.particle.io/libs/neopixel/1.0.0/tab/example/a-rainbow.cpp


#192

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


#193

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.


#194

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.