|
Adafruit WS2801 Library
|
Class that stores state and functions for interacting with WS2801 LEDs. More...
#include <Adafruit_WS2801.h>
Public Member Functions | |
| Adafruit_WS2801 (uint16_t n, uint8_t dpin, uint8_t cpin, uint8_t order=WS2801_RGB) | |
| Constructor for use with arbitrary clock/data pins. More... | |
| Adafruit_WS2801 (uint16_t x, uint16_t y, uint8_t dpin, uint8_t cpin, uint8_t order=WS2801_RGB) | |
| Constructor for use with a matrix configuration, specify w, h for size of matrix. More... | |
| Adafruit_WS2801 (uint16_t n, uint8_t order=WS2801_RGB) | |
| Constructor for use with hardware SPI (specific clock/data pins) More... | |
| Adafruit_WS2801 () | |
| Empty constructor; init pins/strand length/data order later: | |
| ~Adafruit_WS2801 () | |
| Release memory (as needed): | |
| void | begin (void) |
| Activate SPI. | |
| void | show (void) |
| Shows the pixels. | |
| void | setPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b) |
| Set pixel color from separate 8-bit R, G, B components. More... | |
| void | setPixelColor (uint16_t n, uint32_t c) |
| Set pixel color from 'packed' 32-bit RGB value. More... | |
| void | setPixelColor (uint16_t x, uint16_t y, uint8_t r, uint8_t g, uint8_t b) |
| Set pixel color from separate 8-bit R, G, B components using x,y coordinate system. More... | |
| void | setPixelColor (uint16_t x, uint16_t y, uint32_t c) |
| Set pixel color from 'packed' 32-bit RGB value using x,y coordinate system: More... | |
| void | clear () |
| Clear the entire string. | |
| void | updatePins (uint8_t dpin, uint8_t cpin) |
| Change pin assignment post-constructor, using arbitrary pins. More... | |
| void | updatePins (void) |
| Change pin assignment post-constructor, switching to hardware SPI. | |
| void | updateLength (uint16_t n) |
| Change strand length. More... | |
| void | updateOrder (uint8_t order) |
| Change RGB data order. More... | |
| uint16_t | numPixels (void) |
| Returns the number of pixels currently connected. More... | |
| uint32_t | getPixelColor (uint16_t n) |
| Query color from previously-set pixel. More... | |
Class that stores state and functions for interacting with WS2801 LEDs.
| Adafruit_WS2801::Adafruit_WS2801 | ( | uint16_t | n, |
| uint8_t | dpin, | ||
| uint8_t | cpin, | ||
| uint8_t | order = WS2801_RGB |
||
| ) |
Constructor for use with arbitrary clock/data pins.
| n | How many LEDs there are |
| dpin | Data pin |
| cpin | Clock pin |
| order | RGB or GRB |
| Adafruit_WS2801::Adafruit_WS2801 | ( | uint16_t | x, |
| uint16_t | y, | ||
| uint8_t | dpin, | ||
| uint8_t | cpin, | ||
| uint8_t | order = WS2801_RGB |
||
| ) |
Constructor for use with a matrix configuration, specify w, h for size of matrix.
| x | Width of the matrix |
| y | Height of the matrix |
| dpin | Data pin |
| cpin | Clock pin |
| order | RGB or GRB |
| Adafruit_WS2801::Adafruit_WS2801 | ( | uint16_t | n, |
| uint8_t | order = WS2801_RGB |
||
| ) |
Constructor for use with hardware SPI (specific clock/data pins)
| n | |
| order |
| void Adafruit_WS2801::setPixelColor | ( | uint16_t | n, |
| uint8_t | r, | ||
| uint8_t | g, | ||
| uint8_t | b | ||
| ) |
Set pixel color from separate 8-bit R, G, B components.
| n | Pixel to set |
| r | Red value |
| g | Green value |
| b | Blue value |
| void Adafruit_WS2801::setPixelColor | ( | uint16_t | n, |
| uint32_t | c | ||
| ) |
Set pixel color from 'packed' 32-bit RGB value.
| n | Pixel to set |
| c | packed 32-bit RGB value to set the pixel |
| void Adafruit_WS2801::setPixelColor | ( | uint16_t | x, |
| uint16_t | y, | ||
| uint8_t | r, | ||
| uint8_t | g, | ||
| uint8_t | b | ||
| ) |
Set pixel color from separate 8-bit R, G, B components using x,y coordinate system.
| x | Pixel x |
| y | Pixel y |
| r | Red value |
| g | Green value |
| b | Blue value |
| void Adafruit_WS2801::setPixelColor | ( | uint16_t | x, |
| uint16_t | y, | ||
| uint32_t | c | ||
| ) |
Set pixel color from 'packed' 32-bit RGB value using x,y coordinate system:
| x | Pixel x |
| y | Pixel y |
| c | packed 32-bit RGB value to set the pixel |
| void Adafruit_WS2801::updatePins | ( | uint8_t | dpin, |
| uint8_t | cpin | ||
| ) |
Change pin assignment post-constructor, using arbitrary pins.
| dpin | Data pin |
| cpin | Clock pin |
| void Adafruit_WS2801::updateLength | ( | uint16_t | n | ) |
Change strand length.
| n | Length to change to |
| void Adafruit_WS2801::updateOrder | ( | uint8_t | order | ) |
Change RGB data order.
| order | Order to switch to |
| uint16_t Adafruit_WS2801::numPixels | ( | void | ) |
Returns the number of pixels currently connected.
| uint32_t Adafruit_WS2801::getPixelColor | ( | uint16_t | n | ) |
Query color from previously-set pixel.
| n | Pixel to query |
1.8.13