SimpleRelay
Loading...
Searching...
No Matches
SimpleRelay Class Reference

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.
 

Detailed Description

Definition at line 29 of file SimpleRelay.h.

Constructor & Destructor Documentation

◆ SimpleRelay()

SimpleRelay::SimpleRelay ( uint8_t  pin,
bool  isInverted = false 
)

Constructor for the class.

Parameters
pinan output pin to use for the relay control.
isInvertedsets 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::~SimpleRelay ( )

Destructor for the class.

Definition at line 42 of file SimpleRelay.cpp.

Member Function Documentation

◆ isRelayOn()

bool SimpleRelay::isRelayOn ( void  )

Get information if a relay is currently ON.

Returns
true if relay is on, false otherwise.

Definition at line 78 of file SimpleRelay.cpp.

◆ off()

void SimpleRelay::off ( void  )

Set relay to OFF state.

Definition at line 58 of file SimpleRelay.cpp.

◆ on()

void SimpleRelay::on ( void  )

Set relay to ON state.

Definition at line 50 of file SimpleRelay.cpp.

◆ toggle()

void SimpleRelay::toggle ( void  )

Toggle relay state.

Definition at line 66 of file SimpleRelay.cpp.


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