Buffered RGB/RGBW LED strip driver. Keep the object alive while using its buffer.
More...
|
|
| Adafruit_NeoPixel (uint16_t n, uint8_t p=6, neoPixelType t=NEO_GRB+NEO_KHZ800) |
| | Construct a strip with n LEDs, output pin p, and type t (color order plus bit rate). The no-argument constructor requires updateLength(), setPin(), and updateType() before use. Call begin() before show(); buffer edits are sent only by show().
|
|
| Adafruit_NeoPixel (void) |
| | Construct a strip with n LEDs, output pin p, and type t (color order plus bit rate). The no-argument constructor requires updateLength(), setPin(), and updateType() before use. Call begin() before show(); buffer edits are sent only by show().
|
|
| ~Adafruit_NeoPixel () |
| | Release the pixel buffer and return the configured pin to input mode.
|
|
void | begin (void) |
| | Configure the strip output pin for use.
|
|
void | show (void) |
| | Transmit the current pixel buffer synchronously, observing the latch delay.
|
|
void | setPin (uint8_t p) |
| | Change the output pin, releasing the previous pin when initialized.
|
|
void | setPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b) |
| | Set zero-based pixel n in the buffer; out-of-range indices are ignored. Byte overloads use 0-255 R/G/B and optional white; packed colors use 0xWWRRGGBB. Call show() to transmit the change.
|
|
void | setPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w) |
| | Set zero-based pixel n in the buffer; out-of-range indices are ignored. Byte overloads use 0-255 R/G/B and optional white; packed colors use 0xWWRRGGBB. Call show() to transmit the change.
|
|
void | setPixelColor (uint16_t n, uint32_t c) |
| | Set zero-based pixel n in the buffer; out-of-range indices are ignored. Byte overloads use 0-255 R/G/B and optional white; packed colors use 0xWWRRGGBB. Call show() to transmit the change.
|
|
void | setBrightness (uint8_t) |
| | Set overall brightness from 0 (off) to 255 (maximum). Rescales stored bytes with precision loss; repeatedly changing it is lossy.
|
|
void | clear () |
| | Zero the pixel buffer without transmitting it.
|
|
void | updateLength (uint16_t n) |
| | Reallocate the strip buffer for n LEDs; contents are cleared. Allocation failure leaves an empty strip.
|
|
void | updateType (neoPixelType t) |
| | Set color order and signaling rate; changing RGB/RGBW size reallocates storage.
|
|
uint8_t * | getPixels (void) const |
| | Return the borrowed raw byte buffer in the configured device color order. Direct writes bypass brightness scaling; do not free the buffer.
|
|
uint8_t | getBrightness (void) const |
| | Return the configured overall brightness, 0 through 255.
|
| int8_t | getPin (void) |
| | Return the configured output GPIO number.
|
|
uint16_t | numPixels (void) const |
| | Return the number of LEDs currently allocated.
|
|
static uint32_t | Color (uint8_t r, uint8_t g, uint8_t b, uint8_t w) |
| | Pack 0-255 R/G/B and optional white components into 0xWWRRGGBB.
|
|
uint32_t | getPixelColor (uint16_t n) const |
| | Return the packed color at zero-based pixel n, or zero if out of range. Brightness rescaling may prevent exact recovery of the original components.
|
| bool | canShow (void) |
| | Return whether at least 300 microseconds have elapsed since the previous transmission.
|
Buffered RGB/RGBW LED strip driver. Keep the object alive while using its buffer.