Automatic Curtain  MVP
Software repository for an automatic curtain using stepper motor, TMC2209 and ESP32
Indicator Class Reference

#include <indicator.h>

Public Member Functions

 Indicator (std::shared_ptr< Logging > &logging)
 Fetches the LED pin from config, setups pin mode, setup WS2812 RGBLED, initializes logger. More...
 
 ~Indicator ()
 Destroy the Indicator object. More...
 
bool UpdateStatus (CONFIG_SET::DEVICE_STATUS status)
 Updates the color of LED by using mapping from status to color of LED. More...
 

Private Member Functions

void InitializeLED ()
 Initializes RGB LED. More...
 

Private Attributes

std::shared_ptr< Logginglogger_
 
CRGB leds_ [CONFIG_SET::NUMBER_OF_LEDS]
 

Constructor & Destructor Documentation

◆ Indicator()

Indicator::Indicator ( std::shared_ptr< Logging > &  logging)

Fetches the LED pin from config, setups pin mode, setup WS2812 RGBLED, initializes logger.

Here is the call graph for this function:

◆ ~Indicator()

Indicator::~Indicator ( )

Destroy the Indicator object.

Member Function Documentation

◆ InitializeLED()

void Indicator::InitializeLED ( )
private

Initializes RGB LED.

Here is the caller graph for this function:

◆ UpdateStatus()

bool Indicator::UpdateStatus ( CONFIG_SET::DEVICE_STATUS  status)

Updates the color of LED by using mapping from status to color of LED.

Parameters
statusDevice Status to be used for updation
Returns
true: if the updation was successful
false: otherwise

Member Data Documentation

◆ leds_

CRGB Indicator::leds_[CONFIG_SET::NUMBER_OF_LEDS]
private

◆ logger_

std::shared_ptr<Logging> Indicator::logger_
private

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