MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
MiniR4LED Class Reference

Class for controlling an RGB LED. More...

#include <MiniR4LED.h>

Public Member Functions

 MiniR4LED ()
 
void begin (uint8_t pin)
 Initializes the LED. (Built-in at Uno Pin 7)
 
bool setColor (uint8_t idx, uint32_t rgb)
 Sets the color of the LED.
 
bool setColor (uint8_t idx, uint8_t r, uint8_t g, uint8_t b)
 Sets the color of the LED using separate RGB values.
 
void setBrightness (uint8_t idx, uint8_t brightness)
 Sets the brightness of the LED.
 

Detailed Description

Class for controlling an RGB LED.

This class provides functionality to set colors and brightness for an RGB LED connected to a specified pin. It uses the WS2812B protocol for communication.

Definition at line 16 of file MiniR4LED.h.

Constructor & Destructor Documentation

◆ MiniR4LED()

MiniR4LED::MiniR4LED ( )
inline

Definition at line 19 of file MiniR4LED.h.

Member Function Documentation

◆ begin()

void MiniR4LED::begin ( uint8_t pin)
inline

Initializes the LED. (Built-in at Uno Pin 7)

Parameters
pinThe pin number to which the LED is connected.

Definition at line 26 of file MiniR4LED.h.

◆ setBrightness()

void MiniR4LED::setBrightness ( uint8_t idx,
uint8_t brightness )
inline

Sets the brightness of the LED.

Parameters
idxThe index of the LED (1 or 2).
brightnessThe brightness level (0-255). (Default is 255)

Definition at line 87 of file MiniR4LED.h.

◆ setColor() [1/2]

bool MiniR4LED::setColor ( uint8_t idx,
uint32_t rgb )
inline

Sets the color of the LED.

Parameters
idxThe index of the LED (1 or 2).
rgbThe color in RGB format.
Returns
True if the color was set successfully, false otherwise.

Definition at line 56 of file MiniR4LED.h.

◆ setColor() [2/2]

bool MiniR4LED::setColor ( uint8_t idx,
uint8_t r,
uint8_t g,
uint8_t b )
inline

Sets the color of the LED using separate RGB values.

Parameters
idxThe index of the LED (1 or 2).
rRed value (0-255).
gGreen value (0-255).
bBlue value (0-255).
Returns
True if the color was set successfully, false otherwise.

Definition at line 75 of file MiniR4LED.h.


The documentation for this class was generated from the following file: