M5Unit-RGB 0.0.1 git rev:55cb205
Loading...
Searching...
No Matches
m5::unit::UnitAtomMatrixRGB Class Reference

ATOM Matrix built-in 5x5 RGB LED (not an external unit) More...

#include <unit_AtomMatrixRGB.hpp>

Inheritance diagram for m5::unit::UnitAtomMatrixRGB:
m5::unit::UnitRectLED< 5, 5, UnitWS2812 > m5::unit::UnitWS2812 m5::unit::UnitLED

Public Member Functions

virtual bool begin () override
 Begin the unit.
 
- Public Member Functions inherited from m5::unit::UnitRectLED< 5, 5, UnitWS2812 >
virtual uint16_t width () const override
 Logical width considering rotation (0/180: WIDTH, 90/270: HEIGHT)
 
virtual uint16_t height () const override
 Logical height considering rotation (0/180: HEIGHT, 90/270: WIDTH)
 
virtual uint8_t maxRotation () const
 
- Public Member Functions inherited from m5::unit::UnitWS2812
 UnitWS2812 (const uint16_t num_of_pixels)
 
- Public Member Functions inherited from m5::unit::UnitLED
 UnitLED (const uint16_t num_of_pixels, const rgb::Order order)
 Constructor.
 
config_t config ()
 Gets the configuration.
 
void config (const config_t &cfg)
 Set the configuration.
 
uint16_t numPixels () const
 Number of the pixels.
 
uint8_t brightness () const
 Brightness.
 
bool hasWhite () const
 Has white data?
 
rgb::Order order () const
 Color order.
 
int8_t offsetR () const
 Offset of red.
 
int8_t offsetG () const
 Offset of green.
 
int8_t offsetB () const
 Offset of blue.
 
int8_t offsetW () const
 Offset of white.
 
const container_typepixels () const
 pixels container
 
rgb::Color color (const uint16_t n) const
 Get the Color.
 
rgb::Color absoluteColor (const uint16_t n) const
 Get the Color.
 
bool writePixels ()
 Write pixel color to LED.
 
bool show ()
 Write pixel color to LED (alias)
 
void setBrightness (const uint8_t b)
 Set the brightness.
 
bool setPixelColor (const uint16_t n, const uint8_t r, const uint8_t g, const uint8_t b)
 Set pixel color (RGB)
 
bool setPixelColor (const uint16_t n, const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w)
 Set pixel color (RGBW)
 
bool setPixelColor (const uint16_t n, const rgb::wrgb32_color_t c)
 Set pixel color.
 
bool setPixelColor (const uint16_t n, const rgb::Color &c)
 Set pixel color.
 
bool fill (const rgb::Color &c, const uint16_t first=0, const uint16_t count=0)
 Fill the specified range with the specified color.
 
void clear (void)
 Clear pixels.
 
bool fillRainbow (const uint16_t first=0, const uint16_t count=0, const uint8_t firstHue=0)
 Fill the specified range to rainbow.
 
bool fillGradation (const rgb::Color &firstClr, const rgb::Color &lastClr, const uint16_t first=0, const uint16_t count=0)
 Fill the specified range to gradation pixels.
 
bool fillRandom (const uint16_t first=0, const uint16_t count=0)
 Fill the specified range to random color pixels.
 
void shiftLeft (const uint16_t count=1)
 Shift pixels left.
 
void shiftRight (const uint16_t count=1)
 Shift pixels right.
 
void rotateLeft (const uint16_t count=1)
 Rotate pixels left.
 
void rotateRight (const uint16_t count=1)
 Rotate pixels right.
 
float rotationDegree () const
 Get the rotation angle per 1 (degree)
 
int8_t rotation () const
 Get the rotation.
 
void setRotation (const int8_t rot)
 Set the rotation.
 
rgb::Color operator[] (const uint16_t i) const
 rvalue
 
PixelProxy operator[] (const uint16_t i)
 lvalue
 

Additional Inherited Members

- Public Types inherited from m5::unit::UnitLED
using container_type = std::vector<uint8_t>
 pixel container
 
using item_container_type = std::vector<gpio::m5_rmt_item_t>
 item container
 
- Static Public Attributes inherited from m5::unit::UnitRectLED< 5, 5, UnitWS2812 >
static constexpr uint8_t LED_WIDTH
 
static constexpr uint8_t LED_HEIGHT
 
- Protected Member Functions inherited from m5::unit::UnitRectLED< 5, 5, UnitWS2812 >
virtual uint16_t index_of (const uint16_t n) const override
 
- Protected Member Functions inherited from m5::unit::UnitWS2812
virtual gpio::adapter_config_t rmt_config () override
 
virtual gpio::m5_rmt_item_t rmt_item_one () override
 
virtual gpio::m5_rmt_item_t rmt_item_zero () override
 
virtual gpio::m5_rmt_item_t rmt_item_reset () override
 
- Protected Member Functions inherited from m5::unit::UnitLED
virtual types::category_t unit_category () const override
 
container_typepixels ()
 
rgb::Color get_pixel_color (const uint16_t n) const
 
bool set_pixel_color (const uint16_t n, const rgb::Color &c)
 
uint8_t rotation_of (const int8_t r) const
 
container_type rgb888_items ()
 
item_container_type items ()
 
void shift_left (const uint16_t count, const bool wrap)
 
void shift_right (const uint16_t count, const bool wrap)
 

Detailed Description

ATOM Matrix built-in 5x5 RGB LED (not an external unit)

Warning
Do not set brightness too high. Excessive brightness can generate high temperatures and damage the LEDs and acrylic panel. Recommended brightness is 20 or less.

Member Function Documentation

◆ begin()

bool m5::unit::UnitAtomMatrixRGB::begin ( )
overridevirtual

Begin the unit.

Reimplemented from m5::unit::UnitLED.