Easyuino
1.2.0
|
Relay offers a simple API to interact with relay devices. More...
#include <Relay.h>
Public Member Functions | |
Relay (IN uint8_t arduinoPin) | |
Constructor. More... | |
~Relay () | |
Destructor. | |
bool | begin () |
Used to put the device ready to receive requests. More... | |
bool | begin (IN bool isNormallyClosed, IN uint8_t normallyClosedPinLevel) |
Used to initialize the relay API depending on how the relay will be connected. More... | |
void | end () |
Used to stop the device API. More... | |
void | turnOn () |
Turns on the device that is connected to the relay (depends on how the begin(bool,uint8_t) was called) | |
void | turnOff () |
Turns off the device that is connected to the relay (depends on how the begin(bool,uint8_t) was called) | |
bool | isOn () const |
![]() | |
Device () | |
Constructor called by every sub-classes. | |
~Device () | |
Destroy all the resources associated with the device. | |
bool | isInitialized () const |
Verify is the device is initialized and ready to use. More... | |
Additional Inherited Members | |
![]() | |
bool | _isInitialized |
Used to know if the device API is initialized and ready to receive requests. | |
Relay offers a simple API to interact with relay devices.
Easyuino::Relay::Relay | ( | IN uint8_t | arduinoPin | ) |
Constructor.
arduinoPin | Arduino pin that is connected with the relay (normaly called IN pins in the relay boards) |
|
virtual |
Used to put the device ready to receive requests.
Normally this have some default behaviour some devices have other overload method with same name that receives other arguments to device customization.
Implements Easyuino::Device.
bool Easyuino::Relay::begin | ( | IN bool | isNormallyClosed, |
IN uint8_t | normallyClosedPinLevel | ||
) |
Used to initialize the relay API depending on how the relay will be connected.
isNormallyClosed | Define what are the state that relay is powering the device (lamp, engine, etc) Normally Closed or Normally Open |
normallyClosedPinLevel | Digital level of the normally closed relay state (some relays activate on HIGH other on LOW) |
|
virtual |
Used to stop the device API.
After this the the device will not process API requests.
Implements Easyuino::Device.
bool Easyuino::Relay::isOn | ( | ) | const |