|
SimpleRelay
|
Public Member Functions | |
| SimpleRelay (uint8_t pin, bool isInverted=false) | |
| Constructor for the class. | |
| ~SimpleRelay () | |
| Destructor for the class. | |
| void | on (void) |
Set relay to ON state. | |
| void | off (void) |
Set relay to OFF state. | |
| void | toggle (void) |
| Toggle relay state. | |
| bool | isRelayOn (void) |
Get information if a relay is currently ON. | |
Definition at line 29 of file SimpleRelay.h.
| SimpleRelay::SimpleRelay | ( | uint8_t | pin, |
| bool | isInverted = false |
||
| ) |
Constructor for the class.
| pin | an output pin to use for the relay control. |
| isInverted | sets characteristic of a relay. A relay is non-inverted, when it will turn on after setting voltage on output pin to HIGH. In contrary, inverted relay will turn on when output voltage is set to LOW. This parameter is optional and defaults to false. |
Definition at line 32 of file SimpleRelay.cpp.
| SimpleRelay::~SimpleRelay | ( | ) |
Destructor for the class.
Definition at line 42 of file SimpleRelay.cpp.
| bool SimpleRelay::isRelayOn | ( | void | ) |
Get information if a relay is currently ON.
true if relay is on, false otherwise. Definition at line 78 of file SimpleRelay.cpp.
| void SimpleRelay::off | ( | void | ) |
Set relay to OFF state.
Definition at line 58 of file SimpleRelay.cpp.
| void SimpleRelay::on | ( | void | ) |
Set relay to ON state.
Definition at line 50 of file SimpleRelay.cpp.
| void SimpleRelay::toggle | ( | void | ) |
Toggle relay state.
Definition at line 66 of file SimpleRelay.cpp.