RGBLED  1.0.0
Easily control RGB LEDs.
Classes | Public Member Functions | List of all members
RGBLED Class Reference

Public Member Functions

 RGBLED (uint8_t red_pin, uint8_t green_pin, uint8_t blue_pin, CommonElectrode commonElectrode=CommonElectrode::cathode)
 The class constructor. More...
 
void on ()
 Turns the LED ON. More...
 
void off ()
 Turns the LED OFF. More...
 
State state () const
 Returns the state of the LED. More...
 
uint8_t brightness () const
 Returns the brightness of the LED. More...
 
void brightness (uint8_t brightness)
 Sets the LED's brightness. More...
 
void operator() (uint8_t brightness)
 Sets the LED's brightness. More...
 
uint8_t red () const
 Returns the red value. More...
 
void red (uint8_t redValue)
 Sets the red value. More...
 
uint8_t green () const
 Returns the green value. More...
 
void green (uint8_t greenValue)
 Sets the green value. More...
 
uint8_t blue () const
 Returns the blue value. More...
 
void blue (uint8_t blueValue)
 Sets the blue value. More...
 
void operator() (uint8_t redValue, uint8_t greenValue, uint8_t blueValue)
 Sets the RGB values simultaneously. More...
 
uint8_t red_correction () const
 Returns the red correction. More...
 
void red_correction (uint8_t red_correction)
 Sets the red correction. More...
 
uint8_t green_correction () const
 Returns the green correction. More...
 
void green_correction (uint8_t green_correction)
 Sets the green correction. More...
 
uint8_t blue_correction () const
 Returns the blue correction. More...
 
void blue_correction (uint8_t blue_correction)
 Sets the blue correction. More...
 
void show (bool force=false) const
 Updates the LEDs with the current settings. More...
 

Constructor & Destructor Documentation

§ RGBLED()

RGBLED::RGBLED ( uint8_t  red_pin,
uint8_t  green_pin,
uint8_t  blue_pin,
CommonElectrode  commonElectrode = CommonElectrode::cathode 
)

The class constructor.

Parameters
red_pin- the pin connected to red
green_pin- the pin connected to green
blue_pin- the pin connected to blue
commonElectrode- specifies the LED's common electrode

Member Function Documentation

§ blue() [1/2]

uint8_t RGBLED::blue ( ) const

Returns the blue value.

Returns
the blue value

§ blue() [2/2]

void RGBLED::blue ( uint8_t  blueValue)

Sets the blue value.

Parameters
blueValue- the blue value

§ blue_correction() [1/2]

uint8_t RGBLED::blue_correction ( ) const

Returns the blue correction.

Returns
the blue correction

§ blue_correction() [2/2]

void RGBLED::blue_correction ( uint8_t  blue_correction)

Sets the blue correction.

Parameters
blue_correction- the blue correction

§ brightness() [1/2]

uint8_t RGBLED::brightness ( ) const

Returns the brightness of the LED.

Returns
the brightness of the LED

§ brightness() [2/2]

void RGBLED::brightness ( uint8_t  brightness)

Sets the LED's brightness.

Parameters
brightness- the brightness value

§ green() [1/2]

uint8_t RGBLED::green ( ) const

Returns the green value.

Returns
the green value

§ green() [2/2]

void RGBLED::green ( uint8_t  greenValue)

Sets the green value.

Parameters
greenValue- the green value

§ green_correction() [1/2]

uint8_t RGBLED::green_correction ( ) const

Returns the green correction.

Returns
the green correction

§ green_correction() [2/2]

void RGBLED::green_correction ( uint8_t  green_correction)

Sets the green correction.

Parameters
green_correction- the green correction

§ off()

void RGBLED::off ( )

Turns the LED OFF.

§ on()

void RGBLED::on ( )

Turns the LED ON.

§ operator()() [1/2]

void RGBLED::operator() ( uint8_t  brightness)

Sets the LED's brightness.

Parameters
brightness- the brightness value
See also
void RGBLED::brightness(uint8_t brightness)

§ operator()() [2/2]

void RGBLED::operator() ( uint8_t  redValue,
uint8_t  greenValue,
uint8_t  blueValue 
)

Sets the RGB values simultaneously.

Parameters
redValue- the red value
greenValue- the green value
blueValue- the blue value

§ red() [1/2]

uint8_t RGBLED::red ( ) const

Returns the red value.

Returns
the red value

§ red() [2/2]

void RGBLED::red ( uint8_t  redValue)

Sets the red value.

Parameters
redValue- the red value

§ red_correction() [1/2]

uint8_t RGBLED::red_correction ( ) const

Returns the red correction.

Returns
the red correction

§ red_correction() [2/2]

void RGBLED::red_correction ( uint8_t  red_correction)

Sets the red correction.

Parameters
red_correction- the red correction

§ show()

void RGBLED::show ( bool  force = false) const

Updates the LEDs with the current settings.

Parameters
force- forces the update (otherwise update could be skipped if there wasn't a change)

§ state()

State RGBLED::state ( ) const

Returns the state of the LED.

Returns
the state of the LED
See also
State

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