Represents a state indicator for one or more attached actuators, indicators are normally connected to a digital out.
More...
#include <indicator.hpp>
|
| constexpr | Indicator (uint8_t pin) noexcept |
| | Construct a new Indicator object using standard I/O.
|
| |
| void | setState (bool stateToSet) |
| | Set the state of the indicator.
|
| |
| void | setIndex (uint8_t indexToSet) |
| | Set the indicator index on Indicators namespace Array.
|
| |
| auto | addActuator (uint8_t actuatorIndex) -> Indicator & |
| | Add one actuator to controlled controlledActuators vector.
|
| |
| auto | setMode (constants::IndicatorMode indicatorMode) -> Indicator & |
| | Set the mode of the indicator.
|
| |
| void | check () |
| | Switch the indicator based on controlled actuators status.
|
| |
|
void | resizeVectors () |
| | Resize controlled actuators vector to its actual size.
|
| |
| auto | getIndex () const -> uint8_t |
| | Get the indicator index on Indicators namespace Array.
|
| |
Represents a state indicator for one or more attached actuators, indicators are normally connected to a digital out.
◆ Indicator()
| constexpr Indicator::Indicator |
( |
uint8_t |
pin | ) |
|
|
inlineexplicitconstexprnoexcept |
Construct a new Indicator object using standard I/O.
- Parameters
-
| pin | The Arduino pin number for the indicator. |
◆ addActuator()
| auto Indicator::addActuator |
( |
uint8_t |
actuatorIndex | ) |
-> Indicator & |
Add one actuator to controlled controlledActuators vector.
- Parameters
-
| actuatorIndex | index of actuator to be added. |
- Returns
- Indicator& the object instance.
◆ check()
| void Indicator::check |
( |
| ) |
|
Switch the indicator based on controlled actuators status.
The behavior depends on mode setting:
If this->mode = ANY -> If any controlled actuator is ON switch ON the indicator, OFF otherwise. If this->mode = ALL -> If all controlled actuators are ON switch ON the indicator, OFF otherwise. If this->mode = MAJORITY -> If the majority of controlled actuators are ON switch ON the indicator, OFF otherwise.
◆ getIndex()
| auto Indicator::getIndex |
( |
| ) |
const -> uint8_t |
Get the indicator index on Indicators namespace Array.
- Returns
- uint8_t indicator index.
◆ setIndex()
| void Indicator::setIndex |
( |
uint8_t |
indexToSet | ) |
|
Set the indicator index on Indicators namespace Array.
- Parameters
-
◆ setMode()
Set the mode of the indicator.
- Parameters
-
| indicatorMode | the mode to set. |
- Returns
- Indicator& the object instance.
◆ setState()
| void Indicator::setState |
( |
bool |
stateToSet | ) |
|
|
inline |
Set the state of the indicator.
- Parameters
-
| stateToSet | the state to set true=ON, false=OFF. |
The documentation for this class was generated from the following files: