MistyGro API
C++ API for MistyGro's ESP32 controller based on the Arduino framework
Public Member Functions | List of all members
RelayAL Class Reference

#include <relay.h>

Inheritance diagram for RelayAL:
Inheritance graph
[legend]
Collaboration diagram for RelayAL:
Collaboration graph
[legend]

Public Member Functions

 RelayAL (int pin)
 Construct a new active low relay. More...
 
void begin (Switch sw)
 initialise pin and set initial relay state More...
 
void set (Switch state)
 set relay state More...
 
int get_state ()
 Get the current state. More...
 
void toggle ()
 Toggle the relay. More...
 

Detailed Description

Definition at line 86 of file relay.h.

Constructor & Destructor Documentation

◆ RelayAL()

RelayAL::RelayAL ( int  pin)

Construct a new active low relay.

Parameters
pinpin number where relay is wired

Definition at line 36 of file relay.cpp.

Member Function Documentation

◆ begin()

void RelayAL::begin ( Switch  sw)
virtual

initialise pin and set initial relay state

Parameters
sw

Implements Relay.

Definition at line 38 of file relay.cpp.

◆ get_state()

int RelayAL::get_state ( )
virtual

Get the current state.

Returns
int 1 if ON

Implements Relay.

Definition at line 46 of file relay.cpp.

◆ set()

void RelayAL::set ( Switch  state)
virtual

set relay state

Parameters
stateOn to switch on, the state is managed internally

Implements Relay.

Definition at line 44 of file relay.cpp.

◆ toggle()

void RelayAL::toggle ( )
virtual

Toggle the relay.

Implements Relay.

Definition at line 51 of file relay.cpp.


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