cgnuino
Public Member Functions | List of all members
CgnDI Class Reference

Offers convenient digital-in buffering. More...

#include <cgnuino.h>

Public Member Functions

 CgnDI (byte, byte=1, byte=NULL, byte=2)
 Constructor. More...
 
void update ()
 Updates DI buffer by current pin voltages. More...
 
bool on (byte=0)
 Checks whether i-th DI pin is on (active). More...
 
bool off (byte=0)
 Checks whether i-th DI pin is off (inactive). More...
 
bool turnon (byte=0)
 Checks whether i-th DI pin was turned on in current loop. More...
 
bool turnoff (byte=0)
 Checks whether i-th DI pin was turned off in current loop. More...
 
bool change (byte=0)
 Checks whether i-th DI pin was changed from previous loop. More...
 
bool keep (byte=0)
 Checks whether i-th DI pin kept unchanged from previous loop. More...
 

Detailed Description

Offers convenient digital-in buffering.

Constructor & Destructor Documentation

CgnDI::CgnDI ( byte  p,
byte  s = 1,
byte  o = NULL,
byte  d = 2 
)

Constructor.

Parameters
pFirst pin number for digital-in pins.
sNumber of digital-in pins.
oFirst pin number for relaied output pins.
dDelay intervened after a bit change in [ms].

Member Function Documentation

bool CgnDI::change ( byte  i = 0)

Checks whether i-th DI pin was changed from previous loop.

Parameters
iIndex of DI pin in question.
bool CgnDI::keep ( byte  i = 0)

Checks whether i-th DI pin kept unchanged from previous loop.

Parameters
iIndex of DI pin in question.
bool CgnDI::off ( byte  i = 0)

Checks whether i-th DI pin is off (inactive).

Parameters
iIndex of DI pin in question.
bool CgnDI::on ( byte  i = 0)

Checks whether i-th DI pin is on (active).

Parameters
iIndex of DI pin in question.
bool CgnDI::turnoff ( byte  i = 0)

Checks whether i-th DI pin was turned off in current loop.

Parameters
iIndex of DI pin in question.
bool CgnDI::turnon ( byte  i = 0)

Checks whether i-th DI pin was turned on in current loop.

Parameters
iIndex of DI pin in question.
void CgnDI::update ( )

Updates DI buffer by current pin voltages.

Note
For a normal usage, this method is intended to be called once, and only once, inside loop function.

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