Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Functions | Variables
lampda::physical::indicator Namespace Reference

Handle the RGB indicator display. More...

Functions

void init ()
 Initialize the RGB indicator. Call once on program start.
 
void set_color (const utils::ColorSpace::RGB &c)
 Set the color of the indicator.
 
void set_brightness (const uint8_t brightness)
 Set an indicator brightness (0-255)
 
uint8_t get_brightness ()
 Return the brightness of the indicator (0-255)
 
bool breeze (const uint32_t periodOn, const uint32_t periodOff, const utils::ColorSpace::RGB &color)
 Breeze animation.
 
bool color_loop (const uint32_t colorDuration, std::initializer_list< utils::ColorSpace::RGB > colors)
 color loop animation
 
bool blink (const uint32_t offFreq, const uint32_t onFreq, std::initializer_list< utils::ColorSpace::RGB > colors)
 Blink animation.
 
bool blink (const uint32_t offFreq, const uint32_t onFreq, const utils::ColorSpace::RGB &color)
 Blink animation.
 

Variables

static const platform::gpio::DigitalPin ButtonRedPin (utils::RedIndicator)
 
static const platform::gpio::DigitalPin ButtonGreenPin (utils::GreenIndicator)
 
static const platform::gpio::DigitalPin ButtonBluePin (utils::BlueIndicator)
 
static float brightnessMultiplier = 1.0f
 
static constexpr float redColorCorrection = 1.0f
 Scaling for the red color channel of an this RGB diode.
 
static constexpr float greenColorCorrection = 1.0f / 3.0f
 Scaling for the green color channel of an this RGB diode.
 
static constexpr float blueColorCorrection = 1.0f / 4.0f
 Scaling for the blue color channel of an this RGB diode.
 

Detailed Description

Handle the RGB indicator display.

Function Documentation

◆ blink() [1/2]

bool lampda::physical::indicator::blink ( const uint32_t  offFreq,
const uint32_t  onFreq,
const utils::ColorSpace::RGB color 
)
inline

Blink animation.

Parameters
[in]periodOnin mS, on time
[in]periodOffin mS, off time
[in]colorThe color of the animation
Returns
true when the animation finished. It loops automatically if called again

◆ blink() [2/2]

bool lampda::physical::indicator::blink ( const uint32_t  offFreq,
const uint32_t  onFreq,
std::initializer_list< utils::ColorSpace::RGB colors 
)

Blink animation.

Parameters
[in]periodOnin mS, on time
[in]periodOffin mS, off time
[in]colorsThe colors of the animation, colors will cycle between on/off cycles
Returns
true when the animation finished. It loops automatically if called again

◆ breeze()

bool lampda::physical::indicator::breeze ( const uint32_t  periodOn,
const uint32_t  periodOff,
const utils::ColorSpace::RGB color 
)

Breeze animation.

Parameters
[in]periodOnin mS, on time
[in]periodOffin mS, off time
[in]colorThe color of the animation
Returns
true when the animation finished. It loops automatically if called again

◆ color_loop()

bool lampda::physical::indicator::color_loop ( const uint32_t  colorDuration,
std::initializer_list< utils::ColorSpace::RGB colors 
)

color loop animation

Parameters
[in]colorDurationin mS, color time
[in]colorsThe colors of the animation, colors will cycle between on/off cycles
Returns
true when the animation finished. It loops automatically if called again