Represents an actuator (relay) attached to a digital pin.
More...
#include <actuator.hpp>
|
| constexpr | Actuator (uint8_t pin, uint8_t uniqueId, bool normalState=false) noexcept |
| | Construct a new Actuator object, conventional IO version.
|
| |
| auto | setState (bool state) -> bool |
| | Set the new actuator state if the new state can be set.
|
| |
| void | setIndex (uint8_t indexToSet) |
| | store the actuator index in Actuators namespace array.
|
| |
| auto | setAutoOffTimer (uint32_t time_ms) -> Actuator & |
| | Set turn off timer, it represents the timer after that the actuator will be switched off.
|
| |
| auto | setProtected (bool hasProtection) -> Actuator & |
| | Set protection against some turn ON/OFF behaviour.
|
| |
| auto | getIndex () const -> uint8_t |
| | Get the actuator index on Actuators namespace array.
|
| |
| auto | getId () const -> uint8_t |
| | Get the unique ID of the actuator.
|
| |
| auto | getState () const -> bool |
| | Get the state of the actuator.
|
| |
| auto | getDefaultState () const -> bool |
| | Get the default state of the actuator.
|
| |
| auto | hasAutoOff () const -> bool |
| | Get if the actuator has a timer set.
|
| |
| auto | getAutoOffTimer () const -> uint32_t |
| | Get the timer of the actuator in ms.
|
| |
| auto | hasProtection () const -> bool |
| | Get if the actuators is protected against some turn ON/OFF behaviour.
|
| |
| auto | toggleState () -> bool |
| | Switch the state of the actuator (if it was OFF is going to be ON and vice versa).
|
| |
| auto | checkAutoOffTimer () -> bool |
| | Checks if auto off timer is over, switch OFF the actuator if it's over.
|
| |
Represents an actuator (relay) attached to a digital pin.
◆ Actuator()
| constexpr Actuator::Actuator |
( |
uint8_t |
pin, |
|
|
uint8_t |
uniqueId, |
|
|
bool |
normalState = false |
|
) |
| |
|
inlineexplicitconstexprnoexcept |
Construct a new Actuator object, conventional IO version.
- Parameters
-
| pin | pin number |
| uniqueId | the actuator unique id. |
| normalState | the default state of the actuator. |
◆ checkAutoOffTimer()
| auto Actuator::checkAutoOffTimer |
( |
| ) |
-> bool |
Checks if auto off timer is over, switch OFF the actuator if it's over.
- Returns
- true if the state has been changed.
-
false otherwise.
◆ getAutoOffTimer()
| auto Actuator::getAutoOffTimer |
( |
| ) |
const -> uint32_t |
Get the timer of the actuator in ms.
- Returns
- uint32_t the timer of the actuator in ms.
◆ getDefaultState()
| auto Actuator::getDefaultState |
( |
| ) |
const -> bool |
Get the default state of the actuator.
- Returns
- true if ON.
-
false if OFF.
◆ getId()
| auto Actuator::getId |
( |
| ) |
const -> uint8_t |
Get the unique ID of the actuator.
- Returns
- uint8_t unique ID of the actuator.
◆ getIndex()
| auto Actuator::getIndex |
( |
| ) |
const -> uint8_t |
Get the actuator index on Actuators namespace array.
- Returns
- uint8_t actuator index.
◆ getState()
| auto Actuator::getState |
( |
| ) |
const -> bool |
Get the state of the actuator.
- Returns
- true if ON.
-
false if OFF.
◆ hasAutoOff()
| auto Actuator::hasAutoOff |
( |
| ) |
const -> bool |
Get if the actuator has a timer set.
- Returns
- true if has a timer.
-
false if it hasn't a timer.
◆ hasProtection()
| auto Actuator::hasProtection |
( |
| ) |
const -> bool |
Get if the actuators is protected against some turn ON/OFF behaviour.
- Returns
- true if it's protected.
-
false if it's not protected.
◆ setAutoOffTimer()
| auto Actuator::setAutoOffTimer |
( |
uint32_t |
time_ms | ) |
-> Actuator & |
Set turn off timer, it represents the timer after that the actuator will be switched off.
- Parameters
-
| time_ms | timer time in ms, if set to 0 disable timer. |
- Returns
- Actuator& the object instance.
◆ setIndex()
| void Actuator::setIndex |
( |
uint8_t |
indexToSet | ) |
|
store the actuator index in Actuators namespace array.
- Parameters
-
◆ setProtected()
| auto Actuator::setProtected |
( |
bool |
hasProtection | ) |
-> Actuator & |
Set protection against some turn ON/OFF behaviour.
- Parameters
-
| hasProtection | to set the property. |
- Returns
- Actuator& the object instance.
◆ setState()
| auto Actuator::setState |
( |
bool |
state | ) |
-> bool |
Set the new actuator state if the new state can be set.
- Parameters
-
- Returns
- true if the state has been applied.
-
false otherwise.
◆ toggleState()
| auto Actuator::toggleState |
( |
| ) |
-> bool |
Switch the state of the actuator (if it was OFF is going to be ON and vice versa).
- Returns
- true if the state has been changed.
-
false otherwise.
The documentation for this class was generated from the following files: