Offers convenient digital-in buffering.
More...
#include <cgnuino.h>
|
| 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...
|
|
Offers convenient digital-in buffering.
CgnDI::CgnDI |
( |
byte |
p, |
|
|
byte |
s = 1 , |
|
|
byte |
o = NULL , |
|
|
byte |
d = 2 |
|
) |
| |
Constructor.
- Parameters
-
p | First pin number for digital-in pins. |
s | Number of digital-in pins. |
o | First pin number for relaied output pins. |
d | Delay intervened after a bit change in [ms]. |
bool CgnDI::change |
( |
byte |
i = 0 | ) |
|
Checks whether i-th DI pin was changed from previous loop.
- Parameters
-
i | Index of DI pin in question. |
bool CgnDI::keep |
( |
byte |
i = 0 | ) |
|
Checks whether i-th DI pin kept unchanged from previous loop.
- Parameters
-
i | Index of DI pin in question. |
bool CgnDI::off |
( |
byte |
i = 0 | ) |
|
Checks whether i-th DI pin is off (inactive).
- Parameters
-
i | Index of DI pin in question. |
bool CgnDI::on |
( |
byte |
i = 0 | ) |
|
Checks whether i-th DI pin is on (active).
- Parameters
-
i | Index of DI pin in question. |
bool CgnDI::turnoff |
( |
byte |
i = 0 | ) |
|
Checks whether i-th DI pin was turned off in current loop.
- Parameters
-
i | Index of DI pin in question. |
bool CgnDI::turnon |
( |
byte |
i = 0 | ) |
|
Checks whether i-th DI pin was turned on in current loop.
- Parameters
-
i | Index of DI pin in question. |
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: