50 #define DATA_PINS {8, 9}
52 #define COLOR_ORDER grb
83 for (
unsigned int i = 0; i <
N_LEDS; i++) {
97 for (
unsigned int i = 0; i <
N_LEDS; i++) {
#define COLOR_ORDER
Color order of your WS2812 LEDs (Typically grb or rgb)
ws2812_rgb leds[N_LEDS]
RGB array which represents the LEDs.
#define DATA_PINS
Arduino pin(s) used to program the WS2812 device(s). Must share same port! (See https://www....
#define RESET_TIME
Reset time in microseconds (50us recommended by datasheet)
ws2812 ws2812_dev
Device struct.
#define N_LEDS
Number of LEDs on your WS2812 device(s)
ALL PLATFORMS: Data structure to configure a WS2812 device struct.
uint8_t n_dev
Number of WS2812 device to drive.
uint8_t rst_time_us
Time required for the WS2812 device(s) to reset in us.
ws2812_order order
CoColor order of the WS2812 device(s) (ex. rgb, grb, bgr...)
uint8_t * pins
Array of pins used to program WS2812 devices (Must share the same PORT! (ex. PB0, PB1,...
Data structure to hold RGB color values.
ALL PLATFORMS: WS2812 device struct to drive one or more WS2812 devices.
Exposes the Tiny-WS2812 library interface.
void ws2812_close_tx(ws2812 *dev)
Closes a WS2812 transmission.
uint8_t ws2812_config(ws2812 *dev, ws2812_cfg *cfg)
Configures a WS2812 device struct.
void ws2812_prep_tx(ws2812 *dev)
Prepares the host device for data transmission.
void ws2812_tx(ws2812 *dev, ws2812_rgb *leds, size_t n_leds)
Transmits RGB values to the provided WS2812 device.