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

Active high relay. More...

#include <relay.h>

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

Public Member Functions

 RelayAH (int pin)
 Construct a new active high 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

Active high relay.

Definition at line 44 of file relay.h.

Constructor & Destructor Documentation

◆ RelayAH()

RelayAH::RelayAH ( int  pin)

Construct a new active high relay.

Parameters
pinpin number where relay is wired

Definition at line 17 of file relay.cpp.

Member Function Documentation

◆ begin()

void RelayAH::begin ( Switch  sw)
virtual

initialise pin and set initial relay state

Parameters
sw

Implements Relay.

Definition at line 19 of file relay.cpp.

◆ get_state()

int RelayAH::get_state ( )
virtual

Get the current state.

Returns
int 1 if ON

Implements Relay.

Definition at line 27 of file relay.cpp.

◆ set()

void RelayAH::set ( Switch  state)
virtual

set relay state

Parameters
stateOn to switch on, the state is managed internally

Implements Relay.

Definition at line 25 of file relay.cpp.

◆ toggle()

void RelayAH::toggle ( )
virtual

Toggle the relay.

Implements Relay.

Definition at line 29 of file relay.cpp.


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