Low-level interface to LED strips.
More...
#include <OutputHardware.hpp>
|
| | LEDStrip (OutputGPIO dataPin, uint8_t pixelCount, bool useLevelShift, PixelDriver pixelType=PixelDriver::WS2812, PixelFormat pixelFormat=PixelFormat::AUTO) |
| | Create an LED strip object.
|
| |
| uint8_t | getPixelCount () |
| | Retrieve the pixel count in the strip.
|
| |
| void | brightness (uint8_t value) |
| | Set global LED brightness.
|
| |
| void | clear () |
| | Turn off all LEDs.
|
| |
| 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.
|
| |
| void | pixelRGB (uint8_t pixelIndex, uint32_t packedRGB) |
| | Set pixel color in RGB format.
|
| |
| void | pixelRangeRGB (uint8_t fromPixelIndex, uint8_t toPixelIndex, uint32_t packedRGB) |
| | Set color (in RGB format) to a range of pixels.
|
| |
|
void | shiftToNext () |
| | Shift all pixel colors to the next pixel index.
|
| |
|
void | shiftToPrevious () |
| | Shift all pixel colors to the previous pixel index.
|
| |
|
void | show () |
| | Show pixel colors.
|
| |
Low-level interface to LED strips.
Definition at line 29 of file OutputHardware.hpp.
◆ LEDStrip()
Create an LED strip object.
- Parameters
-
| dataPin | GPIO number attached to Din (data input). |
| pixelCount | Total count of pixels in the strip. |
| useLevelShift | Set to false when using 3.3V logic. Set to true when using the level shifter in open-drain mode. |
| pixelType | Pixel driver. |
| pixelFormat | Format of color data (byte order). Set to AUTO for auto-detection. |
◆ brightness()
| void LEDStrip::brightness |
( |
uint8_t | value | ) |
|
|
inline |
Set global LED brightness.
- Parameters
-
| value | Brightness. 255 is the highest and 0 will turn all LEDs off. |
- Note
- LEDs are very bright. Keep this value low for a comfortable experience. Defaults to 15 (decimal).
Definition at line 70 of file OutputHardware.hpp.
◆ clear()
Turn off all LEDs.
- Note
- Effective after show() is called.
◆ getPixelCount()
| uint8_t LEDStrip::getPixelCount |
( |
| ) |
|
|
inline |
Retrieve the pixel count in the strip.
- Returns
- uint8_t Pixel count.
Definition at line 57 of file OutputHardware.hpp.
◆ pixelRangeRGB() [1/2]
| void LEDStrip::pixelRangeRGB |
( |
uint8_t | fromPixelIndex, |
|
|
uint8_t | toPixelIndex, |
|
|
uint32_t | packedRGB ) |
|
inline |
Set color (in RGB format) to a range of pixels.
- Parameters
-
| fromPixelIndex | Index of the first pixel. |
| toPixelIndex | Index of the last pixel. |
| packedRGB | Pixel color in packet RGB format |
Definition at line 135 of file OutputHardware.hpp.
◆ pixelRangeRGB() [2/2]
| void LEDStrip::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.
- Parameters
-
| fromPixelIndex | Index of the first pixel. |
| toPixelIndex | Index of the last pixel. |
| redChannel | Red component of the color. |
| greenChannel | Green component of the color. |
| blueChannel | Blue component of the color. |
- Note
- Effective after show() is called.
◆ pixelRGB() [1/2]
| void LEDStrip::pixelRGB |
( |
uint8_t | pixelIndex, |
|
|
uint32_t | packedRGB ) |
|
inline |
Set pixel color in RGB format.
- Parameters
-
| pixelIndex | Index of the pixel. |
| packedRGB | Pixel color in packet RGB format |
Definition at line 118 of file OutputHardware.hpp.
◆ pixelRGB() [2/2]
| void LEDStrip::pixelRGB |
( |
uint8_t | pixelIndex, |
|
|
uint8_t | redChannel, |
|
|
uint8_t | greenChannel, |
|
|
uint8_t | blueChannel ) |
Set pixel color in RGB format.
- Parameters
-
| pixelIndex | Index of the pixel in the strip. |
| redChannel | Red component of the color. |
| greenChannel | Green component of the color. |
| blueChannel | Blue component of the color. |
- Note
- Effective after show() is called.
The documentation for this class was generated from the following file: