19#include "driver/rmt_tx.h"
70 void brightness(uint8_t value) { brightnessWeight = value + 1; }
106 uint8_t fromPixelIndex,
107 uint8_t toPixelIndex,
109 uint8_t greenChannel,
110 uint8_t blueChannel);
123 (uint8_t)(packedRGB >> 16),
124 (uint8_t)(packedRGB >> 8),
125 (uint8_t)(packedRGB));
136 uint8_t fromPixelIndex,
137 uint8_t toPixelIndex,
142 (uint8_t)(packedRGB >> 16),
143 (uint8_t)(packedRGB >> 8),
144 (uint8_t)(packedRGB));
169 rmt_channel_handle_t rmtHandle =
nullptr;
170 rmt_encoder_handle_t encHandle =
nullptr;
171 bool changed =
false;
172 uint8_t brightnessWeight = 16;
173 uint32_t resetTimeNs = 280000;
175 void normalizeColor(uint8_t &r, uint8_t &g, uint8_t &b);
179 uint8_t greenChannel,
180 uint8_t blueChannel);
206 uint8_t address7bits);
240 void swap() { _state = ~_state; }
275 void *device =
nullptr;
304 void set(
bool state) { _state = state; }
312 bool get() {
return _state; }
319 void swap() { _state = !_state; }
Types and constants required for custom firmware setup.
I2CBus
I2C bus controller.
PixelFormat
Byte order of pixel data.
@ AUTO
Auto-detect based on pixel driver.
Low-level interface to LED strips.
void shiftToPrevious()
Shift all pixel colors to the previous pixel index.
void pixelRangeRGB(uint8_t fromPixelIndex, uint8_t toPixelIndex, uint32_t packedRGB)
Set color (in RGB format) to a range of pixels.
void show()
Show pixel colors.
uint8_t getPixelCount()
Retrieve the pixel count in the strip.
void shiftToNext()
Shift all pixel colors to the next pixel index.
void brightness(uint8_t value)
Set global LED brightness.
void pixelRGB(uint8_t pixelIndex, uint32_t packedRGB)
Set pixel color in RGB format.
void clear()
Turn off all LEDs.
LEDStrip(OutputGPIO dataPin, uint8_t pixelCount, bool useLevelShift, PixelDriver pixelType=PixelDriver::WS2812, PixelFormat pixelFormat=PixelFormat::AUTO)
Create an LED strip object.
void pixelRGB(uint8_t pixelIndex, uint8_t redChannel, uint8_t greenChannel, uint8_t blueChannel)
Set pixel color in RGB format.
void pixelRangeRGB(uint8_t fromPixelIndex, uint8_t toPixelIndex, uint8_t redChannel, uint8_t greenChannel, uint8_t blueChannel)
Set color (in RGB format) to a range of pixels.
8-LED driver based on the PCF8574 GPIO expander
void shiftLeft()
Shift all lights to the left.
uint8_t getState() const
Get the state of each LED.
PCF8574LedDriver(I2CBus bus, uint8_t address7bits)
Construct a LED driver.
void swap()
Invert the state of all LEDs.
void shiftRight()
Shift all lights to the right.
void setLed(uint8_t index, bool state)
Set the state of a single LED.
void setState(uint8_t state)
Set the state of each LED all at once.
void show() const
Show the required LEDs all at once.
A simple LED driver for a single LED.
void swap()
Invert the state of the LED.
SingleLED(OutputGPIO pin)
Create a new single-LED driver.
void set(bool state)
Set the state of the LED.
bool get()
Get the state of the LED.
void show()
Show the state of the LED.
void grant() const
Grant this GPIO for non-exclusive use.
Output-capable GPIO pin number.