Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
Adafruit_NeoPixel Class Reference

Buffered RGB/RGBW LED strip driver. Keep the object alive while using its buffer. More...

#include <Adafruit_NeoPixel.hpp>

Public Member Functions

 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.

Static Public Member Functions

static uint32_t Color (uint8_t r, uint8_t g, uint8_t b)
 Pack 0-255 R/G/B and optional white components into 0xWWRRGGBB.

Protected Attributes

boolean is800KHz
boolean begun
uint16_t numLEDs
uint16_t numBytes
int8_t pin
uint8_t brightness
uint8_t * pixels
uint8_t rOffset
uint8_t gOffset
uint8_t bOffset
uint8_t wOffset
uint32_t endTime

Detailed Description

Buffered RGB/RGBW LED strip driver. Keep the object alive while using its buffer.

Member Function Documentation

◆ canShow()

bool Adafruit_NeoPixel::canShow ( void )
inline

Return whether at least 300 microseconds have elapsed since the previous transmission.

252{ return (micros() - endTime) >= 300L; }
uint32_t micros()
보드 부팅 이후부터 현재까지의 경과 시간을 마이크로초 단위로 구합니다.

◆ getPin()

int8_t Adafruit_NeoPixel::getPin ( void )
inline

Return the configured output GPIO number.

227{ return pin; };

The documentation for this class was generated from the following file: