Datasheet

This updates the whole strip at once, and despite the extra step is actually a good thing. If every call
to setPixelColor() had an immediate effect, animation would appear jumpy rather than buttery
smooth.
You can query the color of a previously-set pixel using getPixelColor():
This returns a 32-bit merged color value.
The number of pixels in a previously-declared strip can be queried using numPixels():
The overall brightness of all the LEDs can be adjusted using setBrightness(). This takes a single
argument, a number in the range 0 (off) to 255 (max brightness). For example, to set a strip to 1/4
brightness:
Just like setPixel(), this does not have an immediate effect. You need to follow this with a call to
show().
setBrightness() was intended to be called once, in setup(), to limit the current/brightness of the
LEDs throughout the life of the sketch. It is not intended as an animation effect itself! The operation
of this function is “lossy” — it modifies the current pixel data in RAM, not in the show() call — in
order to meet NeoPixels’ strict timing requirements. Certain animation effects are better served by
leaving the brightness setting alone, modulating pixel brightness in your own sketch logic and
redrawing the full strip with setPixel().
I’m calling setPixel() but nothing’s happening!
There are two main culprits for this:
1. forgetting to call strip.begin() in setup().
2. forgetting to call strip.show() after setting pixel colors.
Another (less common) possibility is running out of RAM — see the last section below. If the
program sort of works but has unpredictable results, consider that.
Can I have multiple NeoPixel objects on different pins?
Certainly! Each requires its own declaration with a unique name:
uint32_t color = strip.getPixelColor(11);
uint16_t n = strip.numPixels();
strip.setBrightness(64);
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 20 of 39