7#include <initializer_list>
86 this->
r = color.
red * 255;
87 this->
g = color.
green * 255;
88 this->
b = color.
blue * 255;
142 void SetData(std::span<const LEDData> ledData);
152 void SetData(std::initializer_list<LEDData> ledData);
165 void SetBitTiming(units::nanosecond_t highTime0, units::nanosecond_t lowTime0,
166 units::nanosecond_t highTime1,
167 units::nanosecond_t lowTime1);
198 return static_cast<int32_t
>(order);
@ HAL_ALED_BGR
Definition AddressableLEDTypes.h:27
@ HAL_ALED_RBG
Definition AddressableLEDTypes.h:26
@ HAL_ALED_BRG
Definition AddressableLEDTypes.h:28
@ HAL_ALED_GRB
Definition AddressableLEDTypes.h:30
@ HAL_ALED_GBR
Definition AddressableLEDTypes.h:29
@ HAL_ALED_RGB
Definition AddressableLEDTypes.h:25
Definition AddressableLED.h:48
LEDData()
Definition AddressableLED.h:50
void SetLED(const Color8Bit &color)
Definition AddressableLED.h:96
void SetHSV(int h, int s, int v)
A helper method to set all values of the LED.
void SetRGB(int r, int g, int b)
A helper method to set all values of the LED.
Definition AddressableLED.h:65
LEDData(int _r, int _g, int _b)
Definition AddressableLED.h:51
void SetLED(const Color &color)
Definition AddressableLED.h:85
A class for driving addressable LEDs, such as WS2812B, WS2815, and NeoPixels.
Definition AddressableLED.h:34
void Start()
Starts the output.
void SetBitTiming(units::nanosecond_t highTime0, units::nanosecond_t lowTime0, units::nanosecond_t highTime1, units::nanosecond_t lowTime1)
Sets the bit timing.
void SetData(std::initializer_list< LEDData > ledData)
Sets the led output data.
void SetData(std::span< const LEDData > ledData)
Sets the led output data.
AddressableLED & operator=(AddressableLED &&)=default
AddressableLED(int port)
Constructs a new driver for a specific port.
void SetColorOrder(ColorOrder order)
Sets the color order for this AddressableLED.
ColorOrder
Order that color data is sent over the wire.
Definition AddressableLED.h:39
@ kGBR
GBR order.
Definition AddressableLED.h:44
@ kRGB
RGB order.
Definition AddressableLED.h:40
@ kBRG
BRG order.
Definition AddressableLED.h:43
@ kGRB
GRB order. This is the default order.
Definition AddressableLED.h:45
@ kRBG
RBG order.
Definition AddressableLED.h:41
@ kBGR
BGR order.
Definition AddressableLED.h:42
void Stop()
Stops the output.
void SetLength(int length)
Sets the length of the LED strip.
AddressableLED(AddressableLED &&)=default
void SetSyncTime(units::microsecond_t syncTime)
Sets the sync time.
Represents colors that can be used with Addressable LEDs.
Definition Color8Bit.h:23
int red
Red component (0-255).
Definition Color8Bit.h:119
int blue
Blue component (0-255).
Definition Color8Bit.h:125
int green
Green component (0-255).
Definition Color8Bit.h:122
Represents colors that can be used with Addressable LEDs.
Definition Color.h:24
double green
Green component (0-1).
Definition Color.h:871
double red
Red component (0-1).
Definition Color.h:868
double blue
Blue component (0-1).
Definition Color.h:874
A move-only C++ wrapper around a HAL handle.
Definition Types.h:96
constexpr auto format_as(AddressableLED::ColorOrder order)
Definition AddressableLED.h:197
structure for holding one LED's color data.
Definition AddressableLEDTypes.h:14
uint8_t r
red value
Definition AddressableLEDTypes.h:17
uint8_t padding
Definition AddressableLEDTypes.h:18
uint8_t g
green value
Definition AddressableLEDTypes.h:16
uint8_t b
blue value
Definition AddressableLEDTypes.h:15
color
Definition color.h:16