InputEvents v1.4.0
An easy to use but comprehensive Event Library for Buttons, Encoders, Encoder Buttons, Analog Inputs, Joysticks and Switches.
Public Member Functions | List of all members
VirtualPinAdapter Class Reference

Description

A PinAdapter that can set state programtically.

#include <VirtualPinAdapter.h>

Inheritance diagram for VirtualPinAdapter:
Inheritance graph
[legend]

Public Member Functions

 VirtualPinAdapter (bool pressedState=LOW)
 Construct a VirtualPinAdapter. More...
 
void begin ()
 Sets the iniial state. More...
 
bool read ()
 Returns the current state. More...
 
void press ()
 Set the state to pressedState.
 
void release ()
 Set the state to 'not pressedState'.
 
void setState (bool newState)
 Directly set the state. More...
 
virtual void begin ()=0
 Initialise the pin adapter. Must be safe for repeated calls (Idempotent) More...
 
virtual bool read ()=0
 Read the current state of the pin. More...
 

Constructor & Destructor Documentation

◆ VirtualPinAdapter()

VirtualPinAdapter::VirtualPinAdapter ( bool  pressedState = LOW)
inline

Construct a VirtualPinAdapter.

Parameters
pressedStateThe state that represents 'pressed'. Default is LOW.

Member Function Documentation

◆ begin()

void VirtualPinAdapter::begin ( )
inlinevirtual

Sets the iniial state.

Implements PinAdapter.

◆ read()

bool VirtualPinAdapter::read ( )
inlinevirtual

Returns the current state.

Returns
true
false

Implements PinAdapter.

◆ setState()

void VirtualPinAdapter::setState ( bool  newState)
inline

Directly set the state.

Parameters
newState

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