7#include <initializer_list>
83 this->
g =
color.green * 255;
84 this->
b =
color.blue * 255;
152 void SetData(std::span<const LEDData> ledData);
160 void SetData(std::initializer_list<LEDData> ledData);
170 std::span<const LEDData> ledData);
181 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
void SetLED(const wpi::util::Color8Bit &color)
Definition AddressableLED.hpp:92
LEDData(int _r, int _g, int _b)
Definition AddressableLED.hpp:48
void SetRGB(int r, int g, int b)
A helper method to set all values of the LED.
Definition AddressableLED.hpp:61
LEDData()
Definition AddressableLED.hpp:47
void SetHSV(int h, int s, int v)
A helper method to set all values of the LED.
void SetLED(const wpi::util::Color &color)
Definition AddressableLED.hpp:81
void SetColorOrder(ColorOrder order)
Sets the color order for this AddressableLED.
AddressableLED(int channel)
Constructs a new driver for a specific channel.
void SetData(std::span< const LEDData > ledData)
Sets the LED output data.
void SetLength(int length)
Sets the length of the LED strip.
void SetData(std::initializer_list< LEDData > ledData)
Sets the LED output data.
int GetStart() const
Gets the display start of the LED strip in the global buffer.
Definition AddressableLED.hpp:137
ColorOrder
Order that color data is sent over the wire.
Definition AddressableLED.hpp:36
@ kGBR
GBR order.
Definition AddressableLED.hpp:41
@ kBRG
BRG order.
Definition AddressableLED.hpp:40
@ kBGR
BGR order.
Definition AddressableLED.hpp:39
@ kRBG
RBG order.
Definition AddressableLED.hpp:38
@ kGRB
GRB order. This is the default order.
Definition AddressableLED.hpp:42
@ kRGB
RGB order.
Definition AddressableLED.hpp:37
static void SetGlobalData(int start, ColorOrder colorOrder, std::span< const LEDData > ledData)
Sets the LED output data at an arbitrary location in the global buffer.
void SetStart(int start)
Sets the display start of the LED strip in the global buffer.
AddressableLED(AddressableLED &&)=default
int GetChannel() const
Gets the channel for this addressable LED.
Definition AddressableLED.hpp:114
AddressableLED & operator=(AddressableLED &&)=default
A move-only C++ wrapper around a HAL handle.
Definition Types.hpp:16
Represents colors that can be used with Addressable LEDs.
Definition Color8Bit.hpp:23
Represents colors that can be used with Addressable LEDs.
Definition Color.hpp:42
color
Definition color.h:16
Definition CvSource.hpp:15
constexpr auto format_as(AddressableLED::ColorOrder order)
Definition AddressableLED.hpp:180
structure for holding one LED's color data.
Definition AddressableLEDTypes.h:15
uint8_t r
red value
Definition AddressableLEDTypes.h:16
uint8_t g
green value
Definition AddressableLEDTypes.h:17
uint8_t b
blue value
Definition AddressableLEDTypes.h:18